/* Base styles */

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

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

:root {
    --primary: #c7ffc9;
    background: #222;
    font-size: 12px;
    color-scheme: dark;
}

body {
    margin: 0;
}

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

h1 {
    text-align: center;
    font-size: 24px;
    font-weight: 500;
    padding-bottom: 10px;
    border-bottom: 1px solid #444;
    margin: 0 0 10px 0;
}

h2 {
    text-align: center;
    font-size: 20px;
    font-weight: 500;
    margin: 0 0 2px 0;
}

h3 {
    text-align: center;
    font-size: 12px;
    font-weight: 400;
    margin: 0;
}

button {
    border: 1px solid transparent;
    background-color: #18181880;
    border-radius: 4px;

    font-size: 20px;
    font-weight: 300;
    line-height: 2;
    cursor: pointer;
    transition-duration: 0.15s;
}

button:hover {
    color: var(--primary);
    border: 1px solid var(--primary);
}

button:active {
    scale: 107%;
}

button:disabled, button:disabled.menu-option {
    color: #aaa;
    border: 1px solid transparent;
    scale: 100%;
}

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

input, select, textarea {
    background-color: #18181880;
    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 var(--primary);
    border-radius: 4px;
}

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

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

input[type="number"] {
    width: 70px;
}

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: #18181880;
    font-size: 14px;
}

.card {
    background-color: #18181880;
    border: 1px solid var(--primary);
    padding: 5px;
    border-radius: 4px;
    font-size: 12px;
}

/* 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;
}

/* Flex Helper Classes */

.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-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;
}

/* Card Selector */

.card-outer {
    width: 85px;
    display: flex;
    flex-direction: column;
    border: 4px solid #404040;
    border-radius: 8px;
    background-color: #404040;
    color: #ccc;
}

.card-outer.selected {
    background-color: var(--primary);
    border: 4px solid var(--primary);
    color: #222;
}

.card-image {
    width: 100%;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

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

/* 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: 10px;
    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);
}

/* 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);
    }
}