@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
    height: 100dvh;
    width: 100vw;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}

body {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    display: flex;
    align-items: center;
    justify-content: space-around;
    background-color: rgb(0, 0, 51);
}

#slot1, #slot2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 45%;
    height: 80%;
    border: 2px dashed #ccc;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

canvas {
    width: 100%;
    height: 100%;
    border: 2px solid white;
    border-radius: 10px;
    background-color: black;
}

header {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    max-width: 30vw;
    background-color: black;
    color: white;
    padding: clamp(2px, 1vw, 20px);
    border-right: 2px solid white;
    overflow-y: auto;
    padding-bottom: 100px;
}
header::-webkit-scrollbar {
  width: 8px; 
}

header::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

header::-webkit-scrollbar-thumb {
  background: #6c6c6c;
  border-radius: 4px;
}

header::-webkit-scrollbar-thumb:hover {
  background: #3f3f3f;
}
main {
    position: absolute;
    left: 30vw;
    top: 0;
    bottom: 0;
    right: 0;
    display: flex;
    align-items: center;
    align-self: center;
    justify-content: space-around;
    background-color: #f0f0f0;
    aspect-ratio: 2 / 1;
    background-color: transparent;
}

pre {
    padding: 10px;
    border-radius: 5px;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-width: 100%;
    font-size: 1.5rem;
    line-height: 1lh;
}

h1 {
    font-size: 2rem;
    margin-bottom: 20px;
    text-align: center;
}

footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: black;
    color: white;
    text-align: center;
    padding: 10px 0;
}

a {
    color: white;
}

#sorting-algorithms {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

#sorting-algorithms select {
    width: 80%;
    padding: 10px;
    border-radius: 1000px;
    margin-bottom: 10px;
    color: white;
    font-size: 1.025rem;
    border: 2px dashed white;
    background-color: black;
}

.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
}

.controls button {
    width: 80%;
    padding: 10px;
    border-radius: 1000px;;
    margin-bottom: 10px;
    color: white;
    border: 2px dashed white;
    font-size: 1.25rem
}

#settings {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
}

#settings input {
    width: 80%;
    padding: 10px;
    border-radius: 1000px;
    color: white;
    border: 2px dashed white;
    background-color: black;
}

#settings input::placeholder {
    color: rgba(255, 255, 255, 0.66);
}

#resetButton {
    background-color: #790000;
    border: 2px solid white;
}

#startButton {
    background-color: #004f00;
    border: 2px solid white;
}

/* #cover.running {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    z-index: 9999;
} */

h1 {
    margin: 2rem;
}

select, input {
    appearance: none;
}

pre {
    border-radius: 0.5rem;
    background-color: #12171d;
    padding: 1rem;
    margin: 1rem 2rem;
    font-family: monospace; 
}

button:hover {
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 255, 255, 1);
}

#bar-group {
    display: flex;
    gap: 0;
    align-items: center;
    flex-direction: column;
    gap: 0rem;
    width: 100%;
}

#results {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;

    flex-direction: column;
    justify-content: space-around;
    gap: 3vh;

    width: 100%;
    height: 100dvh;
    padding: 4vh 5.5vw;

    overflow-y: auto;
    color: #f0f2f5;
    background-color: #0b0e11;
}

#results.show {
    display: flex;
}

#results * {
    box-sizing: border-box;
    user-select: none;
}

#close-container {
    position: absolute;
    top: 4vh;
    right: 5.5vw;
    z-index: 2;

    display: flex;
    align-items: center;
    gap: 0.4rem;

    padding: 0.5rem 0.7rem;
    border: 1px solid #29313b;
    border-radius: 0.5rem;
    background-color: #12171d;

    transition: background-color 0.2s ease;
}

#close-container:hover {
    background-color: #1a2028;
    cursor: pointer;
}

#close-text {
    color: #a8b1be;
    font-size: 0.9rem;
}

#x-button {
    width: 1.5rem;
    height: 1.5rem;
}

#overview-container {
    display: flex;
    flex: 0 0 35vh;
    align-items: stretch;
    gap: 3.5vw;

    padding: 4vh 2.7vw;

    border: 1px solid #354b32;
    border-radius: 1rem;
    background-color: #17251b;
}

#left-overview {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

#right-overview {
    display: flex;
    flex: 0 0 42%;
    flex-direction: column;
    justify-content: center;
    min-width: 0;

    padding-left: 3.5vw;
    border-left: 2px solid #34452f;
}

.green {
    color: #b7f45b;
}

.white {
    color: #f0f2f5;
}

.gray {
    color: #8993a2;
}

#winner-header {
    margin-bottom: 1.5vh;
    font-family: monospace;
    font-size: 0.9rem;
    font-weight: 600;
}

#winner-name {
    margin-bottom: 1vh;
    font-size: clamp(1.8rem, 3.2vw, 3rem);
    font-weight: 650;
}

#winner-location,
#winner-location2,
#loser-location2 {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

#winner-location {
    margin-bottom: 2vh;
}

#winner-location p,
#winner-location2 p,
#loser-location2 p {
    font-size: 0.95rem;
}

#location-dot,
#location-dot-winner,
#location-dot-loser {
    width: 4px;
    height: 4px;
    flex-shrink: 0;
    border-radius: 50%;
    background-color: currentColor;
}

#time-faster {
    font-size: 0.95rem;
}

#completion-time {
    margin-bottom: 1vh;
    font-family: monospace;
    font-size: 0.85rem;
    text-transform: uppercase;
}

#time-and-unit {
    display: flex;
    align-items: baseline;
    gap: 0.7rem;
}

#time {
    margin: 0;
    font-size: clamp(3rem, 6.5vw, 6rem);
    font-weight: 550;
    line-height: 1.15;
    text-align: left;
}

#time-unit {
    font-size: 1.3rem;
}

#percent-comparison {
    margin-top: 1.5vh;
    font-size: 0.9rem;
}

#percent-less {
    font-size: 1rem;
}

#specifics-container {
    display: flex;
    flex: 0 0 35vh;
    flex-direction: column;
    gap: 2vh;
    min-height: 0;
}

#specifics-title h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

#metrics {
    display: grid;
    grid-template-columns: 2.5rem minmax(11rem, 0.8fr) minmax(10rem, 2fr) 7rem;
    gap: 1.5rem;

    flex: 1;
    min-height: 0;
    padding: 3vh 2vw;

    border: 1px solid #28313b;
    border-radius: 1rem;
    background-color: #12171d;
}

#metric-rank,
#metric-name,
#metric-elapsed-time,
#metric-seconds {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

#metrics h6 {
    margin-bottom: 2.5vh;
    color: #8993a2;
    font-family: monospace;
    font-size: 0.7rem;
    font-weight: 400;
    text-transform: uppercase;
}

#metric-rank {
    gap: 3vh;
    padding-top: 0.5rem;
}

#metric-rank-one,
#metric-rank-two {
    font-family: monospace;
    font-size: 0.95rem;
}

#winner-metric-name,
#loser-metric-name {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 2.5vh;
}

#winner-name2,
#loser-name2 {
    font-size: 1.1rem;
    font-weight: 500;
}

#metric-elapsed-time {
    position: relative;
}

#winner-elapsed-time-bar,
#loser-elapsed-time-bar {
    width: 100%;
    height: 0.65rem;
    flex-shrink: 0;
    border-radius: 3px;
}

#winner-elapsed-time-bar {
    margin-top: 1vh;
    background-color: #b7f45b;
}

#loser-elapsed-time-bar {
    margin-top: 5vh;
    background-color: #687486;
}

#metric-elapsed-labels {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 2vh;
    font-family: monospace;
    font-size: 0.7rem;
}

#metric-seconds {
    align-items: flex-end;
    text-align: right;
}

#winner-seconds,
#loser-seconds {
    margin-bottom: 4.5vh;
    font-family: monospace;
    font-size: 1.5rem;
    white-space: nowrap;
}
