:root {
    --scroll-height: 400px;
    
    /* Light mode colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f0f0f0;
    --bg-overlay: rgba(255, 255, 255, 0.9);
    --text-primary: #000000;
    --text-secondary: #333333;
    --border-color: #ccc;
    --shadow-color: #00000099;
    --button-hover: #cccccc;
    --button-active: #aaaaaa;
    --linkbutton-color: #00aaff;
    --linkbutton-active: #0088cc;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

img {
    max-width: 4rem;
    height: auto;
    -webkit-user-drag: none;
}

.flex-row {
    display: flex;
    flex-direction: row;
    flex: 1;
}

.flex-col {
    display: flex;
    flex-direction: column;
    flex: 1;
}

header {
    height: 3rem;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    font-size: 1.5rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    width: 100vw;
    top: 0;
    left: 0;
    z-index: 1000;
}

.header-bg {
    height: 2rem;
    max-width: initial;
}

header > .links {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

button {
    border: none;
    font-size: 1em;
    border-radius: 5px;
    padding: 0.2rem;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
}
button:hover {
    background-color: var(--button-hover);
    transition: 0.2s;
}
button:active {
    background-color: var(--button-active);
    color: var(--text-primary);
    transition: 0.1s;
}

.headbtn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0rem .9rem;
    height: 3rem;
}
.headbtn:hover {
    background: var(--button-hover);
    transition: 0.1s;
}
.headbtn:active {
    background: var(--button-active);
    color: var(--text-primary);
    transition: 0.1s;
}

.panel {
    height: calc(99vh - 3rem);
    width: 99vw;
    border-radius: 10px;
    display: flex;
    position: fixed;
    flex-direction: column;
    padding: 1rem .5rem .5rem .5rem;
    top: 3.5rem; left: 0.5vw;
    background-color: var(--bg-secondary);
    box-shadow: 0 0 10px var(--shadow-color);
    transition: 0.2s;
    z-index: 999;
    overflow-x: hidden;
    overflow-y: auto;
    animation: 0.2s ease-out panelshown;
}
.panel#connection {
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    gap: 1rem;
}

@keyframes panelshown {
    0% {opacity: 0; transform: scale(1.05);}
    100% {opacity: 1; transform: scale(1.0);}
}

.topbar {
    height: 3rem;
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    top: 3rem; left: 0;
}

.share-overlay {
    height: 100vh; width: 100vw;
    display:flex;
    flex-direction: column;
    position:fixed;
    top:0; left:0;
    align-items: center;
    justify-content: center;
    background-color: var(--shadow-color);
    color: var(--bg-primary);
    z-index: 20000;
}
.share-overlay > .share{
    height: calc(500px + 2rem);
    width: calc(500px + 1rem);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    gap: 1rem;
    border-radius: 10px;
}

.share > img {
    max-width: 100%;
    height: auto;
}

.scroll {
    height: var(--scroll-height);
    overflow: hidden;
    display: block;
    background-color: var(--bg-secondary);
    position: relative;
}

.scroll > .top-scroll {
    overflow: visible;
    width: max-content;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
    z-index: 0;
    animation: scrollmove 5s linear infinite;
}

@keyframes scrollmove {
    0% {transform: translateX(0%);}
    100% {transform: translateX(-50%);}
}

.top-scroll > video {
    filter: blur(5px);
    height: var(--scroll-height);
    margin: 0;
    padding: 0;
    border: none;
    flex-shrink: 0;
}

.scroll > .details {
    color: var(--text-primary);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    position: absolute; /* vertical positioned within .scroll */
    top: 50%; /* vertical center of .scroll / .top-scroll */
    left: 50vw; /* horizontal center of the viewport */
    transform: translate(-50%, -50%);
    background-color: var(--bg-overlay);
    border-radius: 10px;
    z-index: 10;
    pointer-events: auto;
}
.scroll > .details > .text {
    font-size: 1.2rem;
}
.scroll > .details > img {
    height: 3rem;
    max-width: initial;

}

.controller > button {
    width: 20%;
    height: 100%;
    font-size: 10vw;
    background-color: transparent;
    color: transparent;
    border-radius: 0;
    padding: 0.5rem 1rem;
    cursor: pointer;
}
.controller > button:hover {
    color: var(--bg-primary);
    background-color: var(--shadow-color);
    transition: 0.1s;
}

.main {
    width: 100vw; height: fit-content;
    padding: 2rem;
    display: flex;
    gap: 1rem;
    flex-direction: column;
    align-self: center;
    justify-self: center;
    background-color: var(--bg-primary);
} 
.game-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.game {
    border-radius: 5px;
    border: 2px solid var(--border-color);
    padding: 0rem 1rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    animation: 0.3s ease-out game-shown;
}

@keyframes game-shown {
    0% {opacity: 0; transform: translateY(10px);}
    100% {opacity: 1; transform: translateY(0px);}
}

.game:hover {
    box-shadow: #00000030 0px 0px 10px;
    transition: 0.1s;
}

.game > .game-icon {
    aspect-ratio: 1/1;
    border-radius: 5px;
}
.game > .lf {
    margin: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.2em;
}
.game > .lf > .top-line {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 1em;
}
.top-line > .game-name {
    font-size: 1em;
    font-weight: bolder;
}
.top-line > .author {
    font-size: .8em;
}
.game > .lf > .game-info {
    white-space: pre-line;
}

.game > .rt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .2rem;
}

.panel#game > .game-title {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    gap: 1rem;
    padding: 0.5rem;
}

.panel#game > .game-title > .game-name {
    display: flex;
    flex-direction: column;
    background-color: transparent;

}

.panel#game > .game-title > .game-name > .main {
    background-color: transparent;
    width: fit-content;
    font-size: 1.5rem;
    font-weight: bolder;
    align-self: flex-start;
    padding: 0;
}

.panel#game > .game-title > .game-name > .sub {
    background-color: transparent;
    width: fit-content;
    font-size: 1rem;
    font-weight: bolder;
    padding: 0;
}

.panel#game > .game-title > .game-author {
    background-color: transparent;
    font-size: 1rem;
    font-weight: bolder;
    white-space: pre-line;
    text-align: end;
}

.panel#game > .game-imgs {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.panel#game > .game-imgs > .video {
    width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 2px solid var(--border-color);
}

.panel#game > .game-imgs > .thumbnails {
    overflow-y: hidden;
    overflow-x: scroll;
    width: 100%;
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    justify-content: flex-start;
    align-items: center;
}
.panel#game > .game-imgs > .thumbnails > img {
    max-width: 20rem;
    height: auto;
    border-radius: 10px;
    border: 2px solid var(--border-color);
}

.panel#game > .game-context {
    width: 100%;
    height: fit-content;
    margin-top: 1rem;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.panel#game > .game-context > .desc {
    width: 65%;
    font-size: 1rem;
    border-radius: 10px;
    white-space: pre-line;
}
.panel#game > .game-context > .links {
    display: flex;
    flex-direction: column;
    align-items: end;
    width: 30%;
    gap: .3rem;
    font-size: 1rem;
    border-radius: 10px;
}

.panel#game > .game-context > .links > button {
    background-color: var(--linkbutton-color);
    color: var(--bg-primary);
    border: none;
    border-radius: 5px;
    padding: 0.5rem 1rem;
    cursor: pointer;
}
.panel#game > .game-context > .links > button:active {
    background-color: var(--linkbutton-active);
    transform: 0.1s;
}

.fullpanel {
    height: 100vh;
    width: 100vw;
    border-radius: 0px;
    display: flex;
    position: fixed;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    gap: 1rem;
    padding: 1rem .5rem .5rem .5rem;
    top: 0; left: 0;
    background-color: var(--bg-secondary);
    z-index: 9999;
    animation: 0.2s ease-out panelshown;
}

.fullpanel > header {
    width: 100%;
    height: 3rem;
    padding: 0.25rem;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.fullpanel > header > .game-title {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    font-size: 1.5rem;
    font-weight: bolder;
}
.fullpanel > header > .game-title > .game-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 5px;
}
.fullpanel > iframe {
    display: block;
    width: 100%;
    height: auto;
    margin-top: 3rem;
    border: none;
    background-color: #000000;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.hidden {
    display: none;
}