:root {
    --accent: #3133a8;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 150%;
    background: #000000;
    color: #ffffff;
    font-weight: 400;
    font-optical-sizing: auto;
    font-variation-settings: "wght" 400, "opsz" 14;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.container {
    display: flex;
    flex-flow: column nowrap;
    align-items: center;
    margin-top: 5vh;
}

.progress {
    margin: 0em;
    width: 100%;
    display: grid !important;
    grid-template-columns: repeat(3, 1fr); /* 4 equal columns */
    grid-column: 1 / -1;
    font-size: 2vw;
    z-index: 1;
}

/* Medium screens */
@media (max-width: 1279px) {
    .progress {
        /* overrides auto-centering */
        margin-right: 0; /* optional, to be explicit */
    }
}

.progressbattle {
    grid-column: 2;
    margin: 0 auto;
    font-family: Franklin Gothic Heavy;
    color: #ffffff;
}

@keyframes ProgressGlow {
    0% {
        box-shadow: 0 0 10px red;
    }

    20% {
        box-shadow: 0 0 10px orange;
    }

    40% {
        box-shadow: 0 0 10px yellow;
    }

    60% {
        box-shadow: 0 0 10px green;
    }

    80% {
        box-shadow: 0 0 10px blue;
    }

    100% {
        box-shadow: 0 0 10px violet;
    }
}

.progressbar {
    position: relative;
    border: 1px black;
    padding: 0px;
    margin: 2px 0px;
    border-radius: 7.5px;
    grid-column: 2;
    margin-bottom: 10px;
    text-align: center;
}


.progresstext {
    max-width: 492px;
    margin: 3px 0px;
    text-align: center;
    font-size: 1vw;
}

@keyframes hueRotate {
    to {
        filter: hue-rotate(360deg);
    }
}

.progressfill {
    height: 2.5vh;
    border-radius: 4.5px;
    background: linear-gradient(90deg, red, orange, yellow, green, cyan, blue, violet, red);
    animation: hueRotate 4s linear infinite;
    filter: hue-rotate(0deg);
    align-content: center;
    width: 0%;
}


@media (max-width: 1279px) {
    .progressfill {
        height: 20px;
    }
}


.sorter {
    margin: 0em auto;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
    grid-template-rows: repeat(4, auto);
    justify-items: center;
    gap: 15px;
    row-gap: 10px
}

.sorter-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    grid-row: 1 / 3;

}



/* Medium screens */
@media (max-width: 1279px) {
    .sorter-item {
        margin-bottom: 2em;
    }
}

.sorter-item.left {
    grid-column: 3;
}

.sorter-item.right {
    grid-column: 4;
}

.sorter-item .text {
    display: block;
}

    .sorter-item .text > p {
        margin: 0.5em 5px 0px;
        text-align: center;
        font-size: 1.5em;
        line-height: 1.5em;
        transform: translateY(-25%);
        transition: all 0.3s ease;
    }




@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0px currentColor, 0 0 3px currentColor, 0 0 5px currentColor;
    }

    50% {
        box-shadow: 0 0 3px currentColor, 0 0 5px currentColor, 0 0 10px currentColor;
    }

    100% {
        box-shadow: 0 0 0px currentColor, 0 0 3px currentColor, 0 0 5px currentColor;
    }
}


.sorter-item > .image {
    width: 35vw;
    height: 100%;
    max-height: 81vh;
    grid-row: 1 / 3;
    cursor: pointer;
    object-fit: contain;
}



@media (max-width: 1920px) {
    .sorter-item > .image {
        max-height: 78vh;
    }
}

@media (max-width: 1280px) {
    .sorter-item > .image {
        max-height: 74vh;
    }
}

@media (max-width: 1000px) {
    .sorter-item > .image {
        max-height: 74vh;
        width: 45vw;
    }
}

.sorter-item:hover .image {
    transform: translateY(-5%);
    border-color: #00ffcc;
}


.sorter-item:hover .text > p {
    color: #00ffcc;
    text-shadow: 0 0 10px #00ffcc;
    transform: translateY(-50%);
}

.sorter-item > .text {
    width: auto;
    height: auto;
    display: block;
    place-self: center;
    grid-row: 1 !important;
    text-decoration-line: underline;
    font-family: Gabriola;
    color: #9595ff;
    z-index: 1;
}

    .sorter-item > .text > p {
        margin: 0.5em 5px 0px;
        width: calc(100%-10px);
        text-align: center;
        font-size: 3vw;
        line-height: 1.5em;
        grid-row: 1 !important;
        transform: translateY(-25%);
    }

@media (max-width: 1279px) {
    .sorter-item > .text > p {
    }
}


img.left, img.right {
    border: 3px solid #000000;
    color: #ffffff; /* sync text color with border */
    transition: border-color 0.6s ease, box-shadow 0.6s ease;
    border-radius: 0px;
    box-shadow: 0 0 15px currentColor;
    animation: pulseGlow 3s ease-in-out infinite; /* slower, stronger pulse */
}




.button {
    border: 3px solid #0035e3;
    text-align: center;
    padding: 10%;
    width: 50%;
    grid-column: 1 / -1;
    justify-self: center;
    cursor: pointer;
    border-radius: 15px;
    font-weight: bold;
    transition: border-color 0.6s ease, box-shadow 0.6s ease;
    border-radius: 0px;
    box-shadow: 0 0 15px currentColor;
    animation: pulseGlow 3s ease-in-out infinite; /* slower, stronger pulse */
    color: white;
    
}


    .button p {
        top: 50%;
        left: 50%;
    }

.starting.start.button {
    padding: 2%;
    grid-row: 7;
}

.starting.load.button {
    padding: 2%;
    grid-row: 8 !important;
    display: none;
}


.sorting.button, .finished.button {
    padding: 0%;
    grid-row: auto;
    margin: 1;
    display: none;
    top: -100%;
    align-content: center;
}

.sorting.button {
}

.finished.button {
    box-shadow: linear-gradient(90deg, red, orange, yellow, green, cyan, blue, violet, red);
    animation: hueRotate 2s linear infinite;
    filter: hue-rotate(0deg);
    min-height: 75px;
}

@media (max-width: 1279px) {
    .finished.button {
    }
}

.loading.button {
    grid-row: 7 !important;
    padding: 2%;
    display: none;
}

    .loading.button > div {
        background-color: #333;
        border-radius: 100%;
        -webkit-animation: sk-scaleout 1.0s infinite ease-in-out;
        animation: sk-scaleout 1.0s infinite ease-in-out;
    }

    /* Animation taken from: http://tobiasahlin.com/spinkit/ */

    .loading.button > span {
        margin: auto auto 20%;
        font-size: 0.7em;
    }

@-webkit-keyframes sk-scaleout {
    0% {
        -webkit-transform: scale(0)
    }

    100% {
        -webkit-transform: scale(1.0);
        opacity: 0;
    }
}

@keyframes sk-scaleout {
    0% {
        -webkit-transform: scale(0);
        transform: scale(0);
    }

    100% {
        -webkit-transform: scale(1.0);
        transform: scale(1.0);
        opacity: 0;
    }
}


.options {
    margin: 1em auto;
    display: grid;
    text-align: center;
    grid-template-columns: repeat(5, 1fr);
    grid-gap: 10px;
}

/* Medium screens */
@media (max-width: 1279px) {
    .options {
        margin-left: 0rem; /* optional, to be explicit */
    }
}

.options > div {
    font-size: 1.2rem;
    display: flex;
}

label {
    cursor: pointer;
    display: flex;
    align-items: center;
    background: rgb(0 0 0);
    border: 1px solid rgb(255 255 255);
    padding: 0.4rem 0.65rem;
    border-radius: 10px;
    margin-bottom: 10px;
    gap: 0.2rem; /* space between checkbox and text */
    transition: background .18s ease, box-shadow .18s ease, transform .08s ease;
}


    label:hover {
        color: #00e7ff;
        background: rgba(255,255,255,0.10);
        box-shadow: 0 4px 14px rgb(0 157 255 / 60%);
        transform: translateY(-1px);
    }

    label[data-gen="gen1"] {
        border: 2px solid #ff6666;
    }

    label[data-gen="gen2"] {
        border: 2px solid #ffa500;
    }

    label[data-gen="gen3"] {
        border: 2px solid #66ff66;
    }

    label[data-gen="gen4"] {
        border: 2px solid #66ccff;
    }

    label[data-gen="gen5"] {
        border: 2px solid #cc66ff;
    }


.options > .large.option {
    grid-column: span 5;
    text-align: center;
    width: 100%;
    display: flex;
    font-size: 1rem;
    flex-direction: column;
    align-items: center;
    height: 2em;
    margin-bottom: 2rem
}

.large.option strong {
    display: block;
    font-size: 1.5em;
    padding: 0.25em 0.5em;
    background: #000000;
    border: 1px solid #ffffff;
    font-family: impact;
}


.options > hr {
    grid-column: span 5;
    width: 100%;
}

#select-all-container {
    opacity: 1;
    transition: opacity 0.2s ease-in-out;
}

#select-all {
    display: inline-block;
    text-align: center;
    opacity: 1 !important;
    font-weight: bold;
    animation: fall-in 0.3s ease-out forwards;
}

@keyframes fall-in {
    0% {
        opacity: 0;
        transform: translateY(-100%);
    }

    100% {
        opacity: 1;
        transform: translateY(0%);
    }
}

#select-all-container.show {
    opacity: 1;
}

.image.selector {
    margin-top: 2em;
    width: 500px;
    display: none;
    text-align: center;
    font-size: 0.75em;
}

.time.taken {
    display: none;
    text-align: center;
    font-size: 0.75em;
}

@media (max-width: 1279px) {
    .image.selector {
    }
}

@media (max-width: 1279px) {
    .time.taken {
    }
}

.results {
    font-size: 0.75em;
    display: flex;
    margin-top: 2em;
    max-width: 80vw;
    background: #000000;
}

@media (max-width: 1279px) {
    .results {
    }
}

@media all and (min-width: 600px) {
    .results {
        flex-flow: row wrap;
        /* 2px for borders */
    }
}

.trailing {
    display: flex;
    width: 80%;
    margin: 1em auto;
    justify-content: center;
    flex-wrap: wrap;
    max-height: calc(5 * (125px + 2px) + 1 * (15px + 2px));
    grid-gap: 25px;
}


@media (max-width: 1279px) {
    .trailing {
        margin: 1em auto;
        display: grid;
        text-align: center;
        grid-template-columns: repeat(5, 1fr);
        width: 100%;
        font-size: 1.0rem;
    }
}

.result {
    height: auto;
    margin-bottom: -1px;
    display: grid;
    width: 211px;
    grid-template-columns: repeat(2, 0.7fr);
    border: 1px solid #ffffff;
    margin: 5px;
    background-color: #ffffff;
    font-size: 1em;
    object-position: center;
    background: #000000;
    color: rgb(255 255 255)
}


@media (max-width: 1279px) {
    .result {
        margin: 1em auto;
        display: grid;
        text-align: center;
        width: 100%;
        display: grid;
        font-size: 1.5rem;
        grid-template-columns: auto;
    }
}

.result.image {
    width: 15%;
    margin-bottom: 1em;
    display: grid;
    margin: 10px;
    grid-template-columns: 100%;
    grid-template-rows: auto;
}

@media (max-width: 1279px) {
    .result.image {
        width: 30%;
        margin-bottom: 1em;
        display: grid;
        margin: 10px;
        grid-template-columns: 100%;
        grid-template-rows: auto;
    }
}

.result.image .right > div {
    padding-top: 25px;
}

.result.image .right {
    padding: 10%;
    grid-column: 1 / 1;
    grid-row: 2 / 2;
    height: auto;
    width: auto;
}

@keyframes rainbowGlow {
    0% {
        box-shadow: 0 0 10px red;
    }

    20% {
        box-shadow: 0 0 10px orange;
    }

    40% {
        box-shadow: 0 0 10px yellow;
    }

    60% {
        box-shadow: 0 0 10px green;
    }

    80% {
        box-shadow: 0 0 10px blue;
    }

    100% {
        box-shadow: 0 0 10px violet;
    }
}

.result.image img {
    max-width: 100%;
    max-height: 30vh;
    object-fit: contain;
    animation: rainbowGlow 3s infinite alternate;
}


.result.spacer {
    height: 1px;
    background-color: #000000;
}

.podium {
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
    margin: 1em auto;
}

.result > .left {
    text-align: center;
    background-color: #0035e3;
    height: 40px;
}

@media (max-width: 1279px) {
    .result > .left {
        text-align: center;
        background-color: #0035e3;
        height: 40px;
        margin-bottom: 0px;
    }
}

.result.image .left {
    width: 100%;
    align-content: center;
    align-items: center;
    place-content: center;
}

.result.image > .aleft span {
    top: 50%;
    right: 15px;
    margin-top: -0.375em;
}

.result > .right {
    width: 160px;
    padding: 0px;
    text-align: center;
    color: #ffffff;
    font-weight: bold;
    text-decoration-line: underline;
}

@media (max-width: 1279px) {
    .result > .right {
        width: 160px;
        padding-bottom: 15%;
        padding-top: 10%;
        text-align: center;
        align-items: center;
        color: #ffffff;
        font-weight: bold;
        text-decoration-line: underline;
    }
}

.result:not(.image) > div {
    display: flex;
    align-items: center;
    justify-content: center;
}

.info {
    margin-top: 2rem;
    display: block;
    text-align: center;
    font-weight: bold;
    font-size: 0.6875em;
    width: 80%;
    line-height: 1.6em;
    color: #17ff00;
}

/* Medium screens */
@media (max-width: 1279px) {
    .info {
    }
}

.info p:nth-of-type(1) {
    color: #fff;
}

.info p:nth-of-type(2) {
    color: red;
}


a {
    color: #990000;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
}

    a:hover {
        color: #FF6600;
    }

    a:visited {
        color: #0094ff;
    }



/* transition-ready state */
.info, .options {
    transition: opacity 300ms ease, transform 300ms ease, visibility 300ms;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* hidden state when body has .loaded */
body.loaded .info,
body.loaded .options {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    pointer-events: none;
}

/* instant hide if you prefer */
body.loaded-instant .info,
body.loaded-instant .options {
    display: none !important;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .info, .options {
        transition: none;
    }
}

