/* Entry point, imported in dev, inlined into a single file by rollup build */
body {
    margin: 0;
}

* {
    font-family: "Noto Sans Mono", monospace;
    scrollbar-width: thin;
}

h1 {
    text-align: center;
    font-size: 24px;
    font-weight: 500;
    padding-bottom: 12px;
    margin: 0 0 12px 0;

    /* Hairline that fades out at both ends, with a short accent tick in the middle */
    background:
            linear-gradient(var(--primary), var(--primary)) bottom center / 48px 2px no-repeat,
            linear-gradient(90deg, #fff0, #ffffff30 20%, #ffffff30 80%, #fff0) bottom / 100% 1px no-repeat;
}

h2 {
    font-size: 22px;
    font-weight: 400;
    letter-spacing: 1px;
    margin: 0 0 2px 0;
}

h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--primary);
}

h3::before, h3::after {
    content: "";
    flex: 1;
    height: 1px;
}

h3::after {
    background: linear-gradient(90deg, var(--line), transparent);
}

h3::before {
    background: linear-gradient(90deg, transparent, var(--line));
}

/* Base styles */

@property --primary {
    syntax: "<color>";
    inherits: false;
    initial-value: #c7ffc9;
}

@property --progress {
    syntax: "<number>";
    inherits: false;
    initial-value: 0;
}

:root {
    --primary: #c7ffc9;
    --course: #ff7eb9;
    --line: #ffffff1f;
    --gold: #ffd76a;
    --silver: #d5dde6;
    --bronze: #e3a074;
    --danger: #ff7a7a;
    background: #222;
    font-size: 12px;
    color-scheme: dark;
}

/* Scale on hover elements */

.hover-107 {
    transition-duration: 0.15s;
    cursor: pointer;
}

.hover-107:hover:not(.disabled) {
    scale: 107%;
}

/* Animations */

.flashing {
    animation: flashing 1.5s ease-in-out infinite;
}

@keyframes flashing {
    0% {
        border: 1px solid var(--primary);
    }
    50% {
        border: 1px solid #ffc0ff;
    }
    100% {
        border: 1px solid var(--primary);
    }
}

button {
    border: 1px solid #ffffff12;
    background-color: #0000004d;
    border-radius: 4px;

    color: inherit; /* Fix safari using -apple-system-blue by default */
    font-size: 20px;
    font-weight: 300;
    line-height: 2;
    cursor: pointer;
    transition-duration: 0.15s;
}

button:hover, button.menu-option[data-selected="true"] {
    color: var(--primary);
    border-color: color-mix(in srgb, var(--primary) 75%, transparent);
    background-color: color-mix(in srgb, var(--primary) 10%, #0000004d);
}

button:active {
    scale: 107%;
}

button:disabled, button:disabled.menu-option {
    color: #aaa;
    border-color: transparent;
    background-color: #0000004d;
    scale: 100%;
}

button.danger:hover {
    color: var(--danger);
    border-color: var(--danger);
    background-color: color-mix(in srgb, var(--danger) 10%, #0000004d);
}

.card-outer {
    width: 85px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background-color: #0000004d;
    color: #ffffffa7;
    transition: 0.15s;
}

.card-outer.selected {
    color: var(--primary);
    border-color: color-mix(in srgb, var(--primary) 75%, transparent);
    background-color: color-mix(in srgb, var(--primary) 15%, #0000004d);
}

.card-image {
    width: 100%;
    border-radius: 4px;
    display: block;
}

.card-text {
    text-align: center;
    font-size: 14px;
    line-height: 16px;
}

label {
    font-weight: 300;
    font-size: 16px;
}

input, select, textarea {
    background-color: #00000059;
    padding-left: 4px;
    border: none;
    border-left: 2px solid var(--primary);
    color: var(--primary);
    font-weight: 500;
    font-size: 16px;
    transition-duration: 0.15s;
    outline: 1px solid transparent;
}

input:hover, select:hover, input:focus, select:focus, textarea:hover, textarea:focus {
    outline: 1px solid color-mix(in srgb, var(--primary) 75%, transparent);
    background-color: color-mix(in srgb, var(--primary) 10%, #0000004d);
    border-radius: 4px;
}

input:focus, select:focus, textarea:focus {
    scale: 107%;
}

input[type="text"] {
    width: 170px;
}

input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    vertical-align: sub;
    outline: none;
}

input[type="checkbox"]:hover {
    color: var(--primary);
}

select {
    background-color: #0000004d;
    font-size: 14px;
}


.tip-card {
    background-color: #00000059;
    border: 1px solid color-mix(in srgb, var(--primary) 50%, transparent);
    padding: 5px;
    border-radius: 4px;
    font-size: 12px;
}

.flex5 {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.flex5col {
    display: flex;
    flex-direction: column;
    gap: 5px;
    justify-content: center;
}

.flex10 {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.flex10col {
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
}

.align {
    display: flex;
    align-items: center;
}

/* Loading Bar */

#loading-bar {
    height: 20px;
    width: 300px;
    border-radius: 2px;
    border: 2px solid #222;
    outline: 2px solid var(--primary);

    --progress: 0; /* 0..1 set from JS */

    background-image: linear-gradient(
            90deg,
            var(--primary) 0%,
            var(--primary) calc(var(--progress) * 100%),
            #222 calc(var(--progress) * 100%),
            #222 100%
    );
    transition: --progress 0.25s;
}

#loading-text {
    margin-top: 5px;
    font-weight: bold;
    line-height: 14px;
    color: var(--primary);

    display: block;
    border-left: 2px solid var(--primary);
    text-align: left;
    padding-left: 4px;
}

/* Cyclable Menu Lists */

.menu-option {
    position: relative;
    font-weight: 300;
    cursor: pointer;
    transition-duration: 0.15s;
    padding: 0 18px;
}

.menu-option::before {
    display: inline-block;
    content: "►";
    opacity: 0;
    width: 0;
    transition-duration: 0.15s;
}

.menu-option[data-selected="true"] {
    color: var(--primary);
    padding: 0 8px;
}

.menu-option[data-selected="true"]::before {
    opacity: 1;
    width: 12px;
    padding-right: 8px;
}

/* Usernames */

.username-s, .username-m, .username-l {
    text-align: left;
    font-weight: 300;
    overflow-x: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition-duration: 0.15s;
}

.username-s:hover {
    color: var(--primary);
}

.username-m, .username-l {
    white-space: nowrap;
}

.username-m {
    font-size: 16px;
}

.username-l {
    font-size: 42px;
}

.level-bar-m, .level-bar-l {
    color: #222;
    font-weight: 600;
    border-radius: 4px;

    --progress: 0;
    background-image: linear-gradient(
            to right,
            var(--primary) calc(var(--progress) * 100%),
            #fff calc(var(--progress) * 100%),
            #fff calc((var(--progress) + 0.03) * 100%),
            #ccc calc((var(--progress) + 0.03) * 100%)
    );
    transition: --progress 0.25s;
}

.level-bar-m {
    font-size: 11px;
    line-height: 16px;
    padding: 0 6px;
}

.level-bar-l {
    font-size: 16px;
    padding: 2px 8px;
}

.avatar-s, .avatar-m, .avatar-l {
    align-self: center;
    border-radius: 4px;
    image-rendering: pixelated;
}

.avatar-s {
    width: 16px;
    height: 16px;
}

.avatar-m {
    width: 24px;
    height: 24px;
}

.avatar-l {
    width: 96px;
    height: 96px;
    border-radius: 8px;
    outline: 1px solid transparent;
}

.avatar-l:hover {
    outline: 1px solid var(--primary);
}

/* Asset Loading */

#asset-loading {
    position: absolute;
    right: 4px;
    bottom: 4px;
    color: var(--primary);
    font-weight: 300;
    display: flex;
    flex-direction: column;
    align-items: end;
    text-align: end;
}

/* Toasts */

.toast-container {
    position: absolute;
    text-align: center;
    top: 0;
    width: 100%;
}

.toast-container-top-left {
    left: 12px;
    width: auto;
}

.toast-message {
    width: fit-content;
    margin: 0 auto;
    padding: 6px 12px;
    background-color: #262b27f0;
    border: 1px solid var(--line);
    border-radius: 4px;
    overflow: hidden;
    font-size: 16px;
    animation: toast-fade-in 1s ease-in-out forwards;
}

.toast-fade-out {
    animation: toast-fade-out 0.5s ease-in-out forwards;
}

@keyframes toast-fade-in {
    0% {
        scale: 50%;
        transform: translateY(-250%);
    }
    40% {
        scale: 100%;
    }
    70% {
        transform: translateY(10px);
        scale: 107%;
    }
    100% {
        scale: 100%;
        transform: translateY(10px);
    }
}

@keyframes toast-fade-out {
    0% {
        scale: 100%;
        transform: translateY(10px);
    }
    100% {
        scale: 50%;
        transform: translateY(-250%);
    }
}

.toast-control-time {
    width: 70px;
    line-height: 24px;
    background-color: var(--course);
    color: #000;
    opacity: 0;
    rotate: -2deg;
}

.toast-control-time-pop-in {
    animation: toast-control-time-pop-in 0.5s ease-in-out forwards;
}

@keyframes toast-control-time-pop-in {
    0% {
        opacity: 0;
        scale: 50%;
    }
    50% {
        opacity: 1;
        scale: 114%;
        rotate: -8deg;
    }
    100% {
        opacity: 1;
    }
}

/* Stamina Bar */

.stamina-bar {
    --border-width: 1px;
    --border-color: #ccc;
    --slow-color: #ff8a00;
    --slowdown: 0;
    position: absolute;
    bottom: 12px;
    left: 12px;
    transition: opacity 0.2s ease-out;
}

/* Fades out slowly once fully rested */
.stamina-bar-full {
    opacity: 0;
    transition: opacity 1.5s ease-in 0.5s;
}

/* Flashes as a warning when nearly exhausted */
.stamina-bar-low {
    animation: stamina-bar-flash 0.4s ease-in-out infinite alternate;
}

@keyframes stamina-bar-flash {
    from { opacity: 1; }
    to { opacity: 0.25; }
}

.stamina-bar-frame {
    position: relative;
    width: 12px;
    height: 160px;
    padding: 2px;
    border: var(--border-width) solid transparent;
    border-radius: 4px;
    display: flex;
    align-items: flex-end;
}

/* Draws the border ring, orange below halfway */
.stamina-bar-frame::before {
    content: "";
    position: absolute;
    inset: calc(var(--border-width) * -1);
    border: var(--border-width) solid transparent;
    border-radius: 4px;
    background: linear-gradient(to top, var(--slow-color) 50%, var(--border-color) 50%) border-box;
    -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) padding-box exclude, linear-gradient(#000 0 0);
}

/* Draws ticks halfway on both sides marking where slowdown starts */
.stamina-bar-frame::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    translate: 0 -50%;
    background: linear-gradient(to right,
        var(--slow-color) 4px, transparent 4px calc(100% - 4px), var(--slow-color) calc(100% - 4px));
}

.stamina-bar-fill {
    width: 100%;
    border-radius: 2px;
    transition: height 0.15s ease-out, background-color 0.15s ease-out;
    background-color: color-mix(in oklch, var(--danger) calc(pow(var(--slowdown), 1.25) * 100%), var(--primary));
}

.stamina-bar .ph {
    color: color-mix(in oklch, var(--danger) calc(pow(var(--slowdown), 1.25) * 100%), var(--primary));
}

/* Timer */

.timer {
    position: absolute;
    top: 20px;
    left: calc(50vw - 100px);
    width: 200px;
    text-align: center;
    font-size: 48px;
    font-weight: 300;
    display: none;
}

.timer-fade-in {
    display: block;
    animation: timer-fade-in 0.15s ease-in-out forwards;
}

.timer-fade-out {
    display: block;
    animation: timer-fade-out 0.15s ease-in-out forwards;
}

@keyframes timer-fade-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes timer-fade-out {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

#course-scale, #course-interval {
    width: 70px;
}

.course-button-small {
    font-size: 14px;
    flex-grow: 1;
}

.course-terrain-advanced {
    transition-duration: 0.5s;
    margin: -5px 0;
    max-height: 0;
    overflow: hidden;
}

.course-preview-text {
    position: absolute;
    left: 0;
    top: 0;
    background-color: var(--primary);
    color: #000;
    padding: 0 5px;
    border-bottom-right-radius: 4px;
}

.course-preview, .course-preview-desc {
    width: 100%;
    border: 1px solid color-mix(in srgb, var(--primary) 60%, transparent);
    border-radius: 2px;
    background-color: #0000004d;
    box-shadow: 0 6px 18px #00000040;
}

.course-icon-button {
    line-height: 20px;
    width: 34px;
}

/* Course Drawing Menu */

#draw-map, #draw-desc {
    border: 1px solid color-mix(in srgb, var(--primary) 60%, transparent);
}

#draw-map, #replay-map {
    min-width: 400px;
    min-height: 400px;
    width: min(60vw, 80vh);
    height: min(60vw, 80vh);
    max-width: 800px;
    max-height: 800px;
}

#draw-tooltip {
    display: none;
    position: absolute;
    background-color: #181818d0;
    width: max-content;
    z-index: 10;
    max-height: 500px;
    overflow-y: auto;
    font-size: 14px;
}

#draw-tooltip-header {
    font-weight: 500;
    color: var(--primary);
    padding-bottom: 3px;
    border-bottom: 1px solid #404040;
    margin-bottom: 3px;
}

.event-list-page {
    font-size: 16px;
    width: 140px;
    flex-direction: unset;
    justify-content: end;
    align-items: center;
    gap: 10px;
    padding: 4px 8px;
}

.event-list-component {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 60vh;
    max-height: 500px;
    padding: 2px 8px 2px 8px;
    overflow-y: auto;
}

.event-entry {
    padding: 4px 8px 4px 4px;
    background-color: #0000004d;
    border: 1px solid color-mix(in srgb, var(--primary) 15%, transparent);
    border-radius: 4px;
    transition-duration: 0.15s;
}

.event-entry:hover {
    border-color: color-mix(in srgb, var(--primary) 70%, transparent);
    background-color: color-mix(in srgb, var(--primary) 10%, #0000004d);
    scale: 103%;
    cursor: pointer;
}

.event-name {
    font-size: 18px;
    font-weight: 500;
    text-align: left;
}

.event-finishes {
    font-size: 18px;
    font-weight: 300;
    width: 70px;
    text-align: center;
}

.event-list-text {
    font-size: 14px;
    font-weight: 300;
    color: #ffffffa7;
    margin: auto;
}

/* Finish Menu */

@keyframes text-pop-in {
    0%   { height: 0;    }
    20%  { height: 1.416em; }
    50%  { scale: 110%;  }
    100% { scale: 100%;  }
}


.xp-list {
    margin-top: -15px;
}

.xp-list-entry {
    font-size: 14px;
    font-weight: 300;
    text-align: left;
    overflow: hidden;
    animation: text-pop-in 0.75s forwards;
}
.xp-list-entry-key {
    width: 200px;
}

.xp-list-entry-value {
    color: var(--primary);
    font-weight: 600;
    width: 90px;
}

.results-grid {
    display: grid;
    grid-template-columns: max-content max-content;
    gap: 1px 20px;
    text-align: right;
    font-size: 16px;
    font-weight: 300;
}


.results-grid > *:nth-child(even) {
    color: var(--primary);
    font-weight: 600;
    text-align: left;
}

/* Common Menu styles */

.menu-background {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(7px);
    background: radial-gradient(ellipse at 50% 50%, transparent 40%, #00000050 100%);
    transition-duration: 0.15s;
}

.menu-centering {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    animation: menu-rise 0.25s ease-out;
}

@media (prefers-reduced-motion: reduce) {
    .menu-centering { animation: none; }
}

@keyframes menu-rise {
    0% {
        opacity: 0;
        transform: translate(-50%, calc(-50% + 12px));
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.menu-container {
    background: linear-gradient(180deg, #18201880, #181825b0);
    border: 1px solid color-mix(in srgb, var(--primary) 15%, transparent);
    border-radius: 4px;
    padding: 10px;
    box-shadow: 0 18px 50px #0000005c;
}

.menu-container:not(.menu-centering) {
    position: relative;
}

/* Corner marks */
.menu-container::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 4px;
    pointer-events: none;

    --c: var(--primary);
    --len: 14px;
    background:
            linear-gradient(var(--c), var(--c)) top left / var(--len) 2px,
            linear-gradient(var(--c), var(--c)) top left / 2px var(--len),
            linear-gradient(var(--c), var(--c)) top right / var(--len) 2px,
            linear-gradient(var(--c), var(--c)) top right / 2px var(--len),
            linear-gradient(var(--c), var(--c)) bottom left / var(--len) 2px,
            linear-gradient(var(--c), var(--c)) bottom left / 2px var(--len),
            linear-gradient(var(--c), var(--c)) bottom right / var(--len) 2px,
            linear-gradient(var(--c), var(--c)) bottom right / 2px var(--len);
    background-repeat: no-repeat;
}

/* Pause Menu */

.pause-container {
    position: fixed;
    left: 200px;
    bottom: 133px;
    display: flex;
    flex-direction: column;
}

.pause-text {
    line-height: 1.6;
    font-size: 24px;
}

/* Profile Menu */

.profile-name-input[type="text"] {
    font-size: 30px;
    margin: 7px;
    width: unset;
    min-width: 0;
}

#profile-edit-button {
    font-size: 24px;
    line-height: 24px;
    min-width: 48px;
    height: 48px;
}

.profile-stats {
    display: grid;
    grid-template-columns: max-content 65px max-content 65px;
    justify-content: center;
    gap: 1px 10px;
    text-align: right;
    font-size: 14px;
    font-weight: 300;
}

.profile-stat {
    color: var(--primary);
    font-weight: 500;
    text-align: left;
}

#profile-compass-unlocked, #profile-control-unlocked, #profile-third-unlocked {
    font-size: 10px;
    line-height: 0;
}

/* Profile Avatar Menu */

.avatar-canvas, .avatar-canvas-grid {
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    border-radius: 8px;
}

.avatar-canvas-grid {
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
}

.avatar-icon {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background-color: #0000004d;
    font-size: 20px;
    outline: 2px solid transparent;
    transition-duration: 0.15s;
}

.avatar-icon.selected {
    scale: 107%;
    outline: 2px solid var(--primary);
}

/* Replay Menu */

.replay-entry-box {
    width: 16px;
    height: 16px;
    border: 2px solid white;
    transition-duration: 0.15s;
}

#player-time {
    width: 60px;
    font-size: 14px;
    color: var(--primary);
}

#player-track {
    position: relative;
    flex: 1;
    border: 1px solid var(--primary);
    height: 16px;
    border-radius: 4px;
}

.player-frame {
    width: 2px;
    height: 6px;
    position: absolute;
    pointer-events: none;
}

#player-pause-button {
    height: 24px;
    line-height: 0;
}

.title-main-text {
    font-size: 120px;
    font-weight: 100;
    color: #fff;
    letter-spacing: 5px;
    filter: drop-shadow(0 2px 13px #002030ff);
    line-height: 0.87;
    width: max-content;
    margin-top: -110px;
    transition-duration: 1s;
}

.title-main-text:hover, .title-main-subtext:hover {
    color: var(--primary);
    filter: drop-shadow(0 1px 2px #fff);
}

.title-main-text svg {
    height: 0.714em;
    vertical-align: baseline;
    color: var(--course);
}

.title-main-subtext {
    margin-left: 310px;
    margin-bottom: 38px;
    font-size: 16px;
    font-weight: 300;
    letter-spacing: 2px;
    text-shadow: 0 1px 10px #000000a7;
    z-index: 1;
    transition-duration: 1s;
}

.title-tagline-line {
    width: 110px;
    height: 1px;
    opacity: 0.8;
}

.title-tagline-line:first-of-type {
    background: linear-gradient(90deg, #fff0, var(--course));
}

.title-tagline-line:last-of-type {
    background: linear-gradient(90deg, var(--course), #fff0);
}

.title-main-row {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.title-daily {
    width: 260px;
    display: flex;
    flex-direction: column;
    padding: 14px 12px 12px 12px;
}

.title-daily-name {
    font-size: 12px;
    font-weight: 300;
    color: #ffffffa7;
    margin-bottom: 8px;
}

.daily-leaderboard {
    margin: 4px 0 8px 0;
    min-height: 186px;
    flex: 1;
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--line);
    overflow-y: auto;
}

.daily-empty {
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #ffffffa7;
    font-weight: 300;
}

.daily-reset {
    font-size: 11px;
    font-weight: 300;
    color: #ffffffa7;
    margin-bottom: 8px;
}

.daily-reset b {
    color: var(--primary);
    font-weight: 500;
}

.title-buttons {
    width: 235px;
}

.title-buttons button {
    flex: 1;
    position: relative;
    font-size: 24px;
    line-height: 1.15;
}

.title-buttons button[data-selected="true"] {
    padding: 0 18px;
}

.title-buttons button::before {
    position: absolute;
    left: 14px;
    top: 50%;
    translate: 0 -50%;
    width: auto;
    font-size: 14px;
    padding: 0;
}

.title-buttons button[data-selected="true"]::before {
    width: auto;
    padding: 0;
}

.title-button-sub {
    font-size: 11px;
    font-weight: 300;
    color: #ffffffa7;
    transition-duration: 0.15s;
}

.title-profile-widget {
    position: absolute;
    top: 20px;
    right: 20px;
    min-width: 140px;

    background-color: #0c110d8c;
    border: 1px solid var(--line);
    padding: 4px 6px;
    border-radius: 4px;
    line-height: 1.5;
}

.title-discord {
    font-size: 16px;
    padding: 4px 12px;
    width: max-content;
}

.changelog-box {
    font-weight: 300;
    text-align: left;
    width: 270px;
    padding: 0;
}

.changelog-head {
    padding: 9px 12px;
    color: var(--primary);
    font-weight: 500;
    letter-spacing: 1px;
    cursor: pointer;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.changelog-box.open .changelog-head {
    border-bottom-color: var(--line);
}

.changelog-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease;
}

.changelog-box.open .changelog-body {
    grid-template-rows: 1fr;
}

.changelog-body-inner {
    min-height: 0;
    overflow: hidden;
}

.changelog-arrow {
    transition: transform 0.3s;
}

.changelog-box.open .changelog-arrow {
    transform: rotate(-180deg);
}

.changelog-new {
    color: var(--course);
    transition: opacity 0.3s;
}

.changelog-dot {
    width: 6px;
    height: 6px;
    margin-left: 6px;
    border-radius: 50%;
    background: var(--course);
    animation: changelog-pulse 1.5s ease-in-out infinite;
}

@keyframes changelog-pulse {
    0% { opacity: 1; box-shadow: 0 0 0 0 color-mix(in srgb, var(--course) 50%, transparent); }
    100% { opacity: 0.6; box-shadow: 0 0 0 4px color-mix(in srgb, var(--course) 0%, transparent); }
}

.changelog {
    display: block;
    max-height: 96px;
    overflow-y: auto;
    padding: 8px 12px 14px 12px;
    mask-image: linear-gradient(180deg, #000 calc(100% - 22px), #0000);
    line-height: 1.5;
}

.changelog-date {
    margin-top: 8px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1px;
    color: var(--primary);
    justify-content: start;
}

.changelog-date:first-child {
    margin-top: 0;
}

.changelog-entry {
    color: #ffffffa7;
}

/* Tutorial Menu */

.tutorial-group-progress {
    height: 6px;
    border-radius: 2px;

    --progress: 0;
    background-image: linear-gradient(to right, var(--primary) calc(var(--progress) * 100%), #222 calc(var(--progress) * 100%));
}

.tutorial-card.expanded .tutorial-group-progress {
    border-radius: 2px 2px 0 0;
}

.tutorial-events-collapse {
    display: grid;
    grid-template-rows: 0fr;
    margin-top: -5px;
    transition-duration: 0.3s;
}

.tutorial-card.expanded .tutorial-events-collapse {
    grid-template-rows: 1fr;
}

.tutorial-events-inner {
    overflow: hidden;
    min-height: 0;
}

.tutorial-events-card {
    background-color: #222;
    padding: 5px 5px 5px 23px;
    border-radius: 0 0 4px 4px;
}

.tutorial-events-card .event-entry:hover {
    translate: -10px 0;
}

/* Tutorial Toasts */

.tutorial-bar {
    height: 4px;
    margin: -6px -12px -3px -12px;
}

.tutorial-desc {
    font-size: 11px;
    font-weight: 300;
    text-align: left;
}

.tutorial-actions {
    display: flex;
    flex-direction: column;
    gap: 1px;
    align-items: start;
    font-size: 14px;
    font-weight: 300;
}

.tutorial-action-box {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    border: 2px solid black;
}


.tutorial-action[data-done="true"] {
    color: var(--primary);
    animation: tutorial-action-pop 0.5s ease-in-out;
}

@keyframes tutorial-action-pop {
    0% {
        scale: 100%;
        rotate: 0deg;
    }
    40% {
        scale: 110%;
        rotate: -3deg;
    }
    100% {
        scale: 100%;
        rotate: 0deg;
    }
}

/* View Event Menu */

.view-event-title {
    color: var(--primary);
}

.view-event-description {
    font-size: 14px;
    font-weight: 300;
    width: 400px;
    min-height: 200px;
}

.view-event-note {
    display: inline-block;
    background-color: #404040;
    color: var(--primary);
    font-size: 15px;
    font-weight: 300;
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: 2px 2px 1px #151515;
}

.view-event-actions button:not(.play-button):not(.back-button) {
    padding: 0 18px;
}

.view-event-actions button:not(.play-button):not(.back-button)::before {
    display: none;
}

.view-event-results {
    display: flex;
    flex-direction: column;
    width: 240px;
    max-height: 500px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background-color: #0000004d;
}

.view-event-results-tabs {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--line);
}

.view-event-results-title {
    flex: 1;
    padding: 6px 0 4px 0;
    color: #ffffffa7;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition-duration: 0.15s;
}

.view-event-results-title:hover:not(.disabled) {
    color: #fff;
}

.view-event-results-title.selected {
    color: var(--primary);
    background-color: color-mix(in srgb, var(--primary) 15%, #0000004d);
    border-bottom: 2px solid var(--primary);
    cursor: default;
}

.view-event-results-title.disabled {
    opacity: 0.5;
    cursor: default;
}

.view-event-result-entries {
    flex: 1;
    overflow-y: auto;
}

.view-event-result-entry {
    display: flex;
    gap: 5px;
    align-items: center;
    justify-content: space-between;
    white-space: initial;
    padding: 3px 8px;
    font-size: 12px;
    border-left: 2px solid transparent;
}

.view-event-result-entry + .view-event-result-entry {
    border-top: 1px solid #ffffff0d;
}

.view-event-result-entry.me {
    border-left-color: var(--primary);
    background-color: color-mix(in srgb, var(--primary) 15%, #0000004d);
}

.view-event-result-rank {
    width: 18px;
    flex: none;
    text-align: left;
    font-weight: 600;
    color: #ffffffa7;
}

.view-event-result-rank[data-rank="1"] { color: var(--gold); }
.view-event-result-rank[data-rank="2"] { color: var(--silver); }
.view-event-result-rank[data-rank="3"] { color: var(--bronze); }

.view-event-result-time {
    color: var(--primary);
    font-weight: 300;
    white-space: nowrap;
}

.view-event-results-empty {
    padding: 16px;
    font-weight: 300;
    color: #ffffffa7;
}

.view-event-results-empty b {
    color: #fff;
    font-weight: 500;
    font-size: 14px;
}

.event-replay-button {
    font-size: 16px;
    margin: 4px;
    height: 32px;
    overflow: clip;
}

