body {
    margin: 0;
    background-color: #000;
    color: #fff;
    font-family: Monospace;
    font-size: 13px;
    line-height: 24px;
    overscroll-behavior: none;
}

a {
    color: #ff0;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button {
    cursor: pointer;
    text-transform: uppercase;
}

#info {
    position: absolute;
    top: 0px;
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    text-align: center;
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    pointer-events: none;
    z-index: 1; /* TODO Solve this in HTML */
}

#search-container {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

#search-input {
    width: 400px;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(127, 255, 255, 0.5);
    color: rgba(127, 255, 255, 0.9);
    font-family: Monospace;
    font-size: 14px;
    outline: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

#search-input:focus {
    border-color: rgba(127, 255, 255, 1);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

#search-input::placeholder {
    color: rgba(127, 255, 255, 0.4);
}

#search-count {
    color: rgba(127, 255, 255, 0.75);
    font-family: Monospace;
    font-size: 12px;
    white-space: nowrap;
}

a, button, input, select {
    pointer-events: auto;
}

.lil-gui {
    z-index: 2 !important; /* TODO Solve this in HTML */
}

@media all and ( max-width: 640px ) {
    .lil-gui.root {
        right: auto;
        top: auto;
        max-height: 50%;
        max-width: 80%;
        bottom: 0;
        left: 0;
    }
}

#overlay {
    position: absolute;
    font-size: 16px;
    z-index: 2;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: rgba(0,0,0,0.7);
}

#overlay button {
    background: transparent;
    border: 0;
    border: 1px solid rgb(255, 255, 255);
    border-radius: 4px;
    color: #ffffff;
    padding: 12px 18px;
    text-transform: uppercase;
    cursor: pointer;
}

#notSupported {
    width: 50%;
    margin: auto;
    background-color: #f00;
    margin-top: 20px;
    padding: 10px;
}

a {
    color: #8ff;
}

#menu {
    position: absolute;
    bottom: 20px;
    width: 100%;
    text-align: center;
}

.element {
    width: 240px;
    height: 240px;
    box-shadow: 0px 0px 12px rgba(0, 255, 255, 0.5);
    border: 1px solid rgba(127, 255, 255, 0.25);
    cursor: pointer;
    overflow: hidden;
    position: relative;
    pointer-events: auto;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.element.filtered-out {
    opacity: 0.2;
    transform: scale(0.5);
    pointer-events: none;
}

.element:hover {
    box-shadow: 0px 0px 12px rgba(0, 255, 255, 0.75);
    border: 1px solid rgba(127, 255, 255, 0.75);
}

.element.winner {
    box-shadow: 0px 0px 20px rgba(255, 215, 0, 0.8);
    border: 3px solid rgba(255, 215, 0, 0.9);
}

.element.winner:hover {
    box-shadow: 0px 0px 25px rgba(255, 215, 0, 1);
    border: 3px solid rgba(255, 215, 0, 1);
}

.element img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    user-drag: none;
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
}

.element .info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    padding: 8px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    font-family: Helvetica, sans-serif;
}

.element .info .title {
    font-weight: bold;
    margin-bottom: 2px;
}

#fullscreen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#fullscreen.active {
    display: flex;
}

#fullscreen img {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    user-drag: none;
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
}

#fullscreen .metadata {
    margin-top: 20px;
    text-align: center;
    font-family: Helvetica, sans-serif;
}

#fullscreen .metadata .name {
    font-size: 14px;
    color: rgba(127, 255, 255, 0.75);
    margin-bottom: 5px;
}

#fullscreen .metadata .title {
    font-size: 20px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 5px;
}

#fullscreen .metadata .date {
    font-size: 14px;
    color: rgba(127, 255, 255, 0.75);
    margin-bottom: 5px;
}

#fullscreen .metadata .winner-badge {
    font-size: 16px;
    color: rgba(255, 215, 0, 1);
    font-weight: bold;
    margin-top: 10px;
}

#fullscreen .close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    line-height: 1;
}

#fullscreen .close:hover {
    color: rgba(255, 255, 255, 1);
}

button {
    color: rgba(127, 255, 255, 0.75);
    background: transparent;
    outline: 1px solid rgba(127, 255, 255, 0.75);
    border: 0px;
    padding: 5px 10px;
    cursor: pointer;
}

button:hover {
    background-color: rgba(0, 255, 255, 0.5);
}

button:active {
    color: #000000;
    background-color: rgba(0, 255, 255, 0.75);
}

/* Preloader styles */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

#preloader.hidden {
    opacity: 0;
    pointer-events: none;
}

#preloader .logo {
    font-size: 32px;
    font-weight: bold;
    color: rgba(127, 255, 255, 0.9);
    margin-bottom: 40px;
    font-family: Monospace;
    text-align: center;
}

#preloader .progress-container {
    width: 80%;
    max-width: 600px;
    height: 4px;
    background: rgba(127, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

#preloader .progress-bar {
    height: 100%;
    background: linear-gradient(90deg,
        rgba(0, 255, 255, 0.8) 0%,
        rgba(127, 255, 255, 1) 50%,
        rgba(0, 255, 255, 0.8) 100%);
    width: 0%;
    transition: width 0.3s ease-out;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

#preloader .progress-text {
    margin-top: 20px;
    font-size: 14px;
    color: rgba(127, 255, 255, 0.75);
    font-family: Monospace;
}

#preloader .loading-status {
    margin-top: 10px;
    font-size: 12px;
    color: rgba(127, 255, 255, 0.6);
    font-family: Monospace;
}