/* ================================================================================ */
/* globals */
/* ================================================================================ */

@font-face {
    font-family: pokemon-gb;
    src: url(res/pokemon-gb-font.ttf);
}

* {
    /* font-family: "Candara"; */
    font-family: "Segoe UI";
    color: lightgray;
    text-shadow: 0 1px 1px #000, 0 -1px 1px #000, 1px 0 1px #000, -1px 0 1px #000;
}

body {
    background-color: #090909;
    /* backdrop-filter: grayscale(100%); */
    /* background-image: url(res/background.png); */
    background-repeat: repeat;
    background-size: 10%;
    margin: 0px;
    padding: 0px;
}

img {
    filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, .4));
}

hr {
    width: 100%;
    margin: 0px;
    border: none;
    border-top: 1px solid #2E2E2E;
}

/* ================================================================================ */
/* layout */
/* ================================================================================ */

div.box {
    background-color: #181818;
    border-radius: 10px;
    box-sizing: border-box;
    padding: 16px;
    box-shadow: 0px 0px 2px 2px #000A;
    min-width: 295px;
    @media (pointer:none), (pointer:coarse) {
        flex-grow: 1;
    }
}

div.flex-columns {
    display: flex;
    flex-direction: row;
}

div.flex-rows {
    display: flex;
    flex-direction: column;
}

div.gap {
    gap: 16px;
}

div.justify-center {
    justify-content: center;
}

div.align-center {
    align-items: center;
}

div.wrap {
    flex-wrap: wrap;
}

div.grow {
    flex-grow: 1;
}

div.shrink {
    flex-shrink: 1;
}

div.margin {
    margin: 16px;
}

div.padding {
    padding: 16px;
}

div.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(298px, 1fr));
    grid-auto-rows: min-content;
    grid-gap: 16px;
    overflow: hidden;
}

div.fill {
    height: -webkit-fill-available;
}

div.center-text {
    text-align: center;
}

div.self-center {
    align-self: center;
}

div.self-start {
    align-self: flex-start;
}

div.self-end {
    align-self: flex-end;
}

div.space-between {
    justify-content: space-between;
}

div.space-around {
    justify-content: space-around;
}

div.space-evenly {
    justify-content: space-evenly;
}

.break-word {
    word-break: break-all;
}

/* ================================================================================ */
/* inputs */
/* ================================================================================ */

form {
    margin: 0px;
}

small {
    display: table;
    /* i don't know why but this fixes everything */
}

label {
    display: table;
    /* i don't know why but this fixes everything */
    font-family: "Candara";
    font-size: 14px;
    font-weight: bold;
    height: 32px;
    line-height: 32px;
}

label.divider {
    text-align: center !important;
    color: #3E3E3E;
    text-shadow: none;
    display: flex !important;
    flex-basis: 100%;
    align-items: center;
    line-height: 20px;
    &::before, &::after {
        border-top: 1px solid #2E2E2E;
        content: "";
        flex-grow: 1;
        font-size: 0px;
        line-height: 0px;
    }
    &::before { margin-right: 8px; }
    &::after { margin-left: 8px; }
}

input {
    font-family: "Segoe UI";
    font-size: 14px;
    font-weight: bold;
    height: 32px;
    line-height: 32px;
    background-color: #0E0E0E;
    border: 1px solid black;
    border-radius: 5px;
    padding: 0px 8px;
}

select {
    font-family: "Segoe UI";
    font-size: 14px;
    font-weight: bold;
    height: 32px;
    line-height: 32px;
    background-color: #0E0E0E;
    border: 1px solid black;
    border-radius: 5px;
    padding: 0px 8px;
    width: 100%;
}

button {
    font-family: "Candara";
    font-weight: bold;
    font-size: 14px;
    height: 32px;
    line-height: 32px;
    padding: 0px 8px;
    background-color: #0E0E0E;
    border: 1px solid black;
    border-radius: 5px;
    cursor: pointer;

    &:hover {
        background-color: #1E1E1E;
    }
}

button.primary {
    background-color: #0078D4;
    text-shadow: none;
    color: white;
}

input[type="radio"]+label {
    cursor: pointer;
}

.input-left-half {
    border-top-right-radius: 0px;
    border-bottom-right-radius: 0px;
}

.input-right-half {
    border-top-left-radius: 0px;
    border-bottom-left-radius: 0px;
}

button.danger {
    background-color: darkred;
}

/* ================================================================================ */
/* summary + details */
/* ================================================================================ */

summary {
    font-family: "Candara";
    font-size: 14px;
    font-weight: bold;
    height: 32px;
    line-height: 32px;
    padding-left: 8px;
    box-sizing: border-box;
    border-radius: 5px;
    border: 1px solid #2E2E2E;
}

summary:hover {
    background-color: #2E2E2E;
    cursor: pointer;
}

details>div:nth-of-type(1) {
    margin-top: 16px;
}

details[open] {
    border-radius: 5px;
}

details>summary {
    list-style: none;
}

summary::-webkit-details-marker {
    display: none
}

summary::after {
    float: right;
    content: '►';
    margin-right: 16px;
}

details[open] summary:after {
    float: right;
    content: "▼";
    margin-right: 16px;
}

/* ================================================================================ */
/* game version */
/* ================================================================================ */

::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #2E2E2E;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ================================================================================ */
/* game version */
/* ================================================================================ */

/* select#version {
    min-width: 298px;
} */

/* ================================================================================ */
/* display toggle */
/* ================================================================================ */
div.display-toggle {
    border-radius: 90px;
    padding: 8px;
}

input[name="display-toggle"] {
    display: none;

    &+label {
        display: inline-block;
        padding: 8px 16px;
        border-radius: 90px;
        /* width: 80%; */
        height: 16px;
        line-height: 16px;
        text-align: center;
    }

    &:checked+label {
        background-color: #0E0E0E;
    }
}

/* ================================================================================ */
/* team */
/* ================================================================================ */

/* i don't know any other way to solve this problem */
div#team>div.box {
    max-width: 295px;

    @media (pointer:none),
    (pointer:coarse) {
        max-width: unset;
    }
}

button.add-pokemon {
    height: 128px;

    &::before {
        content: '+';
        font-size: 32px;
        display: block;
        border: 1px dashed gray;
        border-radius: 90px;
        width: 32px;
        height: 32px;
        color: gray;
        font-weight: normal;
        left: calc(50% - 16px);
        position: relative;
        line-height: 25px;
    }
}

/* ================================================================================ */
/* metrics (placeholder) */
/* ================================================================================ */

div.metric {
    display: flex;
    justify-content: center;
}

div.metric>img {
    width: 250px;
    object-fit: scale-down;
}

span.info {
    color: #0078D4;
}

/* ================================================================================ */
/* swal */
/* ================================================================================ */

.custom-swal-popup {
    background-color: #060606;
    border-radius: 10px;
    padding: 0px;
    box-shadow: 0px 0px 2px 2px #000A;
    height: 80vh;
    margin-top: 10vh;

    @media (pointer:none),
    (pointer:coarse) {
        width: 100% !important;
        height: 90vh;
        margin-top: 0;
    }
}

.swal2-confirm,
.swal2-cancel {
    margin-bottom: 20px;
    line-height: 1px;
    height: 48px;
    width: 92px;
}

.custom-swal-html {
    display: flex !important;
    border-radius: 10px;
    margin: 0px !important;
    padding: 0px !important;
}

div:where(.swal2-container) .swal2-html-container {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    text-align: inherit;
    word-wrap: inherit;
    word-break: inherit;
}

.swal2-popup {
    color: inherit;
    font-family: inherit;
    font-size: inherit;
}

div:where(.swal2-container) div:where(.swal2-popup) {
    color: inherit;
    font-family: inherit;
    font-size: inherit;
}

body.swal2-shown>div#main-container {
    filter: blur(5px);
}

/* ================================================================================ */
/* el-switch */
/* ================================================================================ */

label.el-switch {
    display: flex;
    flex-direction: row;
    gap: 16px;
}

label.el-switch>label {
    line-height: 26px;
    height: 26px;
}

/* ================================================================================ */
/* logo */
/* ================================================================================ */
span.logo {
    font-family: pokemon-gb;
    font-size: 32px;
}

/* ================================================================================ */
/* made by */
/* ================================================================================ */

a.made-by {
    text-align: center;
    align-self: center;
    background-color: white;
    height: 32px;
    line-height: 32px;
    border-radius: 5px;
    padding: 0 16px;
    color: black;
    text-decoration: none;
    text-shadow: none !important;
    font-weight: bold;
    font-family: pokemon-gb;
    font-size: 10px;
    text-align: center;
    line-height: 32px;
    height: 32px;

    &::before {
        content: url("res/github-icon.svg");
        vertical-align: middle;
        margin-bottom: 2px;
        display: inline-block;
    }
}

/* ================================================================================ */
/* buy me a coffee */
/* ================================================================================ */

div.buy-me-a-coffee {
    height: 32px;
    align-self: center;

    & * {
        border-radius: 5px;
        font-family: "Cookie";
        color: black;
        text-shadow: none !important;
    }

    & a {
        height: 32px;
        background-color: #FCB52B !important;
        font-size: 20px;
        min-width: 0px;
    }

    & svg {
        height: 20px !important;
    }
}

/* ================================================================================ */
/* glow */
/* ================================================================================ */

.glow {
    border: 1px solid;
    border-image: conic-gradient(from var(--angle), red, yellow, lime, aqua, blue, magenta, red) 1;
    animation: 3s rotate linear infinite;
    /* -webkit-mask:
        linear-gradient(#fff 0 0) padding-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor; 
            mask-composite: exclude; */
}

@keyframes rotate {
    to {
        --angle: 360deg;
    }
}

@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}