@font-face {
    font-family: "google sans";
    src: url("assets/fonts/roboto.woff2") format("woff2");
    font-weight: 300;
}
@font-face {
    font-family: "comic sans";
    src: url("assets/fonts/comicsans.woff2") format("woff2");
    font-weight: 300;
}

/*//////////////////////////////////////////////////////////////////////*/

*, *::before, *::after {box-sizing: border-box; scrollbar-width: none}
*::-webkit-scrollbar {width: 0; height: 0}

html, body {
    margin: 0; height: 100%;
    font-size: 0.95em; font-weight: 100;
    font-family: "google sans";
    color: #eee; background: #131314;
}
html {scrollbar-gutter: stable}

.goog {
    display: flex; height: 100%;
    min-height: 0;
}

:any-link {
    color: #8ab4f8;
    text-decoration-line: underline; text-decoration-style: wavy;
}
:is(a, b, s, i, p, span, em, li, ul, br,
    button, input, textarea,
    h1, h2, h3, h4, h5, h6):not(.readmesidebar *) {user-select: none}
img {
    -webkit-user-drag: none; user-select: none;
}

/*//////////////////////////////////////////////////////////////////////*/

.readmesidebar {
    width: min(320px, 38vw); min-width: 120px;
    background: rgba(128,128,128,0.05); overflow: hidden;
    flex-shrink: 0; transition: none;
    display: flex; flex-direction: column; min-height: 0;
}
.readmesidebar .readmescroll {flex: 1 1 auto; min-height: 0}

.miniplayer {
    flex: 0 0 auto; user-select: none;
    -webkit-user-drag: none;
    display: flex; align-items: center; gap: 8px;
    padding: 8px; margin: 0 8px 8px;
    background: rgba(43, 50, 62, 0.6);
    border-radius: 10px;
}
.miniplayercover {
    width: 40px; height: 40px;
    border-radius: 6px; object-fit: cover;
    flex-shrink: 0;
}
.miniplayermeta {flex: 1 1 auto; min-width: 0}
.miniplayertitle {
    color: #c5d5f3; font-size: 12px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.miniplayerartist {
    color: #c5d5f3; opacity: 0.6;
    font-size: 10px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.miniplayerprogress {
    margin-top: 4px; height: 3px;
    background: rgba(255,255,255,0.08); border-radius: 3px;
    overflow: hidden; cursor: pointer;
    touch-action: none;
}
.miniplayerprogressfill {
    height: 100%; width: 0%;
    background: #8ab4f8;
}
.miniplayertoggle {
    flex-shrink: 0;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: none; cursor: pointer;
    border-radius: 50%;
    color: #c5d5f3;
}
.miniplayertoggle:hover {background: rgba(255,255,255,0.06)}
.miniplayericon {display: none}
.miniplayer.playing .miniplayericonpause {display: block}
.miniplayer:not(.playing) .miniplayericonplay {display: block}

/*//////////////////////////////////////////////////////////////////////*/

.goog:not(.readmeopen) .readmesidebar {
    width: 0; min-width: 0;
    opacity: 0; pointer-events: none;
}

.readmeclose {display: none; margin: 0}

.readmebar {
    display: flex; gap: 8px;
    align-items: center; margin: 0 0 0.5em;
}

.readmecontent {min-width: 0}

.readmenav {display: flex; gap: 6px}
.readmenavbtn {
    font-family: "google sans";
    width: auto !important; height: 32px;
    padding: 0 4px !important;
    border-radius: 50px !important; background: #2b323e;
    color: #c5d5f3; font-size: 12px;
}
.readmenavbtn:hover {background: #2b323e}
.readmenavbtn.active {background: #2b323e}


/* special markdown css below :p */
h1, h2, h3, h4, h5, h6 {
    font-weight: 200; margin: 0;
    line-height: 1;
}

.readmescroll {
    height: 100%; overflow: auto;
    padding: 1em;
}
.readrivemediaoc {max-width: 100%; font-family: "comic sans", cursive}
.readrivemediaoc a {overflow-wrap: anywhere; word-break: break-word}

.readrivemediaoc p {
    color: #ccc; font-size: 13px;
}

.readrivemediaoc img:not([width]) {
    display: block; width: 100%;
    padding-bottom: 1em;
}
.readrivemediaoc img[width] {
    display: inline; vertical-align: middle;
    align-items: baseline;
}

.readrivemediaoc h6 {
    font-size: 0.75em; opacity: 0.75;
    line-height: 1; margin: 0;
}

hr {
    border: none; border-bottom: 1px solid rgba(128,128,128,0.5);
    margin: 1.5em 0; width: 100%;
}

li {
    margin-left: 1em; font-weight: 200;
    font-size: 0.75em; color: #ccc;
}

/*//////////////////////////////////////////////////////////////////////*/

.drivemain {
    flex: 1; display: flex;
    flex-direction: column; min-width: 0;
}

.driveheader {
    display: flex; align-items: center;
    flex-wrap: nowrap; gap: 1em;
    padding: 1em;
}

.searchwrap {
    flex: 1 1 auto; min-width: 0;
}
.searchbar {
    display: flex; align-items: center;
    gap: 4px; background: #1e1f20;
    border-radius: 99px; height: 3em;
    padding: 12px 0 12px 12px;
}
.searchbar .searchinput {
    min-width: 0;
}
.searchbar .viewtoggle.insearch {
    margin-left: auto; height: 3em;
    background: rgba(0,0,0,0.18);
}
.searchinput {
    font-family: "google sans";
    flex: 1; border: none;
    background: transparent; color: #eee;
    font-size: 1.1em; outline: none;
}

.headercontrols {
    display: flex; align-items: center;
}

/*//////////////////////////////////////////////////////////////////////*/

.discordwrap {
    position: relative; height: 3em;
    display: flex; align-items: center;
}

.discordavatarbutton {
    width: 3em; height: 3em;
    margin: 0 0 0 0.25em; padding: 0;
    border: none; border-radius: 50%;
    background: transparent; cursor: pointer;
    display: grid; place-items: center;
}
.discordavatarbutton:hover {
    background: #232324;
}

.discordavatar {
    width: 28px; height: 28px;
    border-radius: 50%; object-fit: cover;
}

.discordavatarimg {
    width: 28px; height: 28px;
    border-radius: 50%; object-fit: cover;
}

/*//////////////////////////////////////////////////////////////////////*/

.discordmenu {
    position: absolute; top: calc(100% + 8px);
    right: 0; min-width: 220px; user-select: none;
    padding: 10px; border-radius: 14px;
    background: #282a2c; z-index: 6767;
}

.discordmenutop {
    display: grid; grid-template-columns: 34px 1fr;
    gap: 1em; align-items: center;
    padding-bottom: 0.25em;
}

.discordmenuavatar {
    width: 3em; height: 3em;
    border-radius: 50%;
    overflow: hidden; display: grid;
    place-items: center;
}
.discordmenuavatar img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}

.discordmenuname {
    font-weight: 600;
    font-size: 1.35em; color: #eee;
    overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap;
}

.discordmenulogout {
    font-family: "google sans" !important;
    width: 100%; display: flex;
    align-items: center; gap: 8px;
    padding: 10px 12px; border-radius: 12px;
    border: none; background: #1e1f20;
    color: #eee; cursor: pointer;
}
.discordmenulogout:hover {background: #232324}

.loginhint {
    position: fixed;
    right: 28px; top: 60px;
}
.loginhint img {
    width: 90px;
    height: auto; display: block;
}
.loginhint.fade {opacity: 0}

/*//////////////////////////////////////////////////////////////////////*/

.headericonbutton {
    flex: 0 0 auto; width: 40px;
    height: 3em; padding: 0;
    border: none; border-radius: 50%;
    background: transparent; cursor: pointer;
    display: grid; place-items: center;
}
.headericonbutton:hover {
    background: #2a2b2c;
}

.headericonbutton:disabled {
    filter: grayscale(1); opacity: 0.42;
    cursor: default; pointer-events: none;
}
/* holy slop */
.commentsbutton .commentsicon {grid-area: 1 / 1}
.commentsbutton .commentsiconoff {display: none}
.commentsbutton.commentsmuted .commentsicon-on {display: none}
.commentsbutton.commentsmuted .commentsiconoff {display: block}

.readmebutton .readmeicon {grid-area: 1 / 1}
.readmebutton .readmeicon-closed {display: none}
.readmebutton.readmeclosed .readmeicon-open {display: none}
.readmebutton.readmeclosed .readmeicon-closed {display: block}

.headeractions {
    display: flex; align-items: center;
    gap: 0.5em;
}

.viewtoggle {
    background: #1e1f20; height: 4em;
    display: flex; align-items: center;
    border-radius: 99px; overflow: hidden;
}
.viewbutton {
    width: 40px; height: 4em;
    border: none; background: none;
    cursor: pointer; display: grid;
    place-items: center;
}
.viewbutton.active {background: #232324}

.refreshwrap {
    position: relative; display: flex;
    align-items: center; justify-content: center;
    min-width: 40px; align-self: center;
    height: 3em; box-sizing: content-box;
}
.refreshbutton {
    width: 40px; height: 3em;
    border: none; border-radius: 50%;
    background: transparent; color: #8ab4f8;
    cursor: pointer; display: grid;
    place-items: center;
}
.refreshbutton:hover {background: #232324}

.refreshtime {
    position: absolute; left: 50%;
    top: calc(100% - 10px); transform: translateX(-50%);
    font-size: 0.7em; color: #9aa0a6;
    line-height: 1.1; white-space: nowrap;
    pointer-events: none;
}

/*//////////////////////////////////////////////////////////////////////*/

.breadcrumbs {
    display: flex; align-items: center;
    flex-wrap: wrap; gap: 6px;
    font-size: 14px;
}

.breadcrumbs button {
    font: inherit; background: none;
    border: none; color: #9aa0a6;
    cursor: pointer; padding: 4px 6px;
    border-radius: 4px;
}

.breadcrumbs button:hover {
    background: #1e1f20; color: #eee;
}

.breadcrumbs button.current {
    color: #eee; font-weight: 500;
    cursor: default;
}

.drivecontent {
    flex: 1; overflow: auto;
    padding: 8px 24px 24px;
}

.drivegrid {
    display: flex; flex-direction: column;
    gap: 12px;
}

/*//////////////////////////////////////////////////////////////////////*/

.folderrow {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px 16px;
}

.foldercard {
    display: flex; align-items: center;
    gap: 8px; padding: 10px;
    min-height: 34px; background: #1b1b1b;
    border-radius: 8px; border: 1px solid transparent;
    cursor: pointer;
}
.foldercard:hover {
    background: #232324;
}

.name {
    overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap;
}

.filegrid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.filegrid.listmode {
    grid-template-columns: 1fr; gap: 4px;
}

.filecard {
    background: #1b1b1b; border-radius: 10px;
    overflow: hidden; border: 1px solid transparent;
    cursor: pointer;
}
.filecard:hover {
    background: #232324;
}

.filehead {
    display: flex; align-items: center;
    gap: 8px; padding: 10px;
}

.filemore {
    margin-left: auto;
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border: none; border-radius: 999px;
    background: transparent;
    cursor: pointer;
    color: #9aa0a6;
}
.filemore:hover {background: rgba(255,255,255,0.06)}
.filemore:active {background: rgba(255,255,255,0.09)}
.filemore svg {display: block}

/*//////////////////////////////////////////////////////////////////////*/

.contextmenuwrap {
    position: fixed; inset: 0;
    z-index: 5000;
}
.contextmenuwrap[hidden] {display: none !important}
.contextmenubackdrop {
    position: absolute; inset: 0;
    background: transparent;
}
.contextmenu {
    position: absolute;
    min-width: 260px; max-width: min(320px, calc(100vw - 16px));
    border-radius: 12px; background: #1b1b1b;
    box-shadow: 0 16px 44px rgba(0,0,0,0.75);
}
.contextmenuitem {
    width: 100%;
    display: flex; align-items: center;
    gap: 10px; padding: 0.5em; border: 0;
    cursor: pointer; background: transparent;
    color: #eee; font: inherit; text-align: left;
}
.contextmenuitem:hover {background: rgba(255,255,255,0.06)}
.contextmenuitem:active {background: rgba(255,255,255,0.09)}
.contextmenuicon {width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 24px}
.contextmenutext {flex: 1 1 auto}

.icon {
    display: block; width: 18px;
    height: 18px; flex: 0 0 18px;
}

/*//////////////////////////////////////////////////////////////////////*/

.thumb {
    aspect-ratio: 1 / 1; background: #0e0e0f;
    display: flex; align-items: center;
    justify-content: center; overflow: hidden;
    position: relative;
}

.thumbicon {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    opacity: 0.35; pointer-events: none;
}
.thumbicon .icon {
    width: 56px; height: 56px;
}

.thumb img {
    width: 100%; height: 100%;
    object-fit: cover; position: relative;
    z-index: 1; border: 0;
    outline: none;
    box-shadow: none;
    background: transparent;
}

.thumbimgpending {
    opacity: 0;
}

.thumbfallback {
    font-size: 12px; color: #9aa0a6;
    padding: 12px; text-align: center;
}

.filegrid.listmode .filecard {
    display: flex; align-items: center;
    border-radius: 8px;
}

.filegrid.listmode .thumb {
    width: 72px; min-width: 72px;
    aspect-ratio: 1; order: -1;
}
.filegrid.listmode .filehead {
    flex: 1;
}

.loadingstate, .emptystate {
    grid-column: 1 / -1; text-align: center;
}

.sogdot {
    width: 20px; height: 20px;
}

.sogloading {
    min-height: 80px; display: flex;
    align-items: center; justify-content: center;
    gap: 6px;
}

/*//////////////////////////////////////////////////////////////////////*/

.medialightbox {
    position: fixed; inset: 0;
    z-index: 600; display: flex;
    align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s;
}

.medialightbox.medialightboxvisible {
    opacity: 1; visibility: visible;
    pointer-events: auto;
}

.medialightbox > .mediabackdrop {
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.76);
}

.medialightbox > .mediabox {
    position: relative; width: 100vw;
    height: 100vh;
    display: flex; align-items: center;
    justify-content: center; border-radius: 12px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
    overflow: visible;
}

.mediabox .mediaclose {
    position: absolute; top: 10px;
    left: 10px; z-index: 2;
    color: #eaeaea; width: auto;
    min-width: 40px; padding: 0 10px;
    border-radius: 999px; font-size: 13px;
}

.mediaviewport {
    position: relative; display: flex;
    width: 100%; height: 100%;
    align-items: center; justify-content: center;
    gap: 10px; padding: 8px;
    overflow: hidden;
}

.mediastage {
    position: relative; flex: 1 1 auto;
    min-width: 0; height: 100%;
    display: flex; align-items: center;
    justify-content: center; overflow: hidden;
}

/*//////////////////////////////////////////////////////////////////////*/

.medianav {
    position: absolute; top: 50%;
    transform: translateY(-50%); z-index: 2000;
    width: 42px; height: 42px;
    border-radius: 999px; background: rgba(19, 19, 20, 0.55);
}
.medianav:hover {
    background: rgba(30, 31, 32, 0.85);
}
.medianavleft {left: 12px}
.medianavright {right: 12px}

/*//////////////////////////////////////////////////////////////////////*/

.mediacontent {
    max-width: 100%; max-height: calc(100vh - 56px);
    display: flex; align-items: center;
    justify-content: center;
}

.mediacontent img,
.mediacontent video {
    max-width: 100%; max-height: calc(100vh - 56px);
    object-fit: contain; border-radius: 8px;
}

.mediacontent video {
    width: 100%; background: #000;
}

.mediaregionlayer {
    position: absolute; inset: 0;
    pointer-events: none; overflow: hidden;
}

.mediaregion {
    position: absolute;
    border: 1px solid rgba(255, 193, 7, 0.95);
}
.mediaregion.active {
    border-color: #00e5a8;
    box-shadow: 0 0 0 1px rgba(0,229,168,0.65) inset;
}

.mediastage.commentfocus::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.18);
    pointer-events: none;
    z-index: 1;
}
.mediastage.commentfocus .mediacontent {position: relative; z-index: 2}
.mediastage.commentfocus .mediaregionlayer,
.mediastage.commentfocus .mediainfo {z-index: 2}

.mediastage.commentfocus .mediacontent {
    filter: brightness(0.5)
}

.mediastage.commentfocus .mediacontent img {
    background: #000;
    border-radius: 8px;
}
.mediaregionlayer.selecting {
    pointer-events: auto;
    cursor: crosshair;
    touch-action: none;
}
.mediaregiondraft {
    position: absolute;
    border: 1px dashed rgba(138,180,248,0.95);
    background: rgba(138,180,248,0.16);
}

.mediainfo {
    position: absolute; bottom: 5px; left: 5px; 
    padding: 8px 12px; border-radius: 0.5em;
    background: rgba(0,0,0,0.5); color: #e3e3e3;
    font-size: 13px; font-weight: 300; max-width: 62%;
    line-height: 1.35; word-break: break-word;
}
.mediainfofilename {
    font-size: 11px;
    color: #e3e3e3;
}
.mediainfometa {
    font-size: 8px;
    opacity: 0.75;
    line-height: 1.3;
}

.mediacomments {
    position: absolute; top: 8px;
    right: 8px; bottom: 8px;
    width: min(360px, 34vw); 
    border-radius: 10px;
    display: flex; z-index: 5;
    flex-direction: column; overflow: hidden;
    overscroll-behavior: contain;
    touch-action: pan-y;
    pointer-events: auto;
}
.mediacomments[hidden] {display: none !important}

.mediacommentslist {
    flex: 1 1 auto; min-height: 0;
    overflow: auto; display: flex;
    flex-direction: column;
    gap: 5px; overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.mediacomment {
    background: #161719; border-radius: 8px;
    padding: 8px 10px;
}
.mediacommentchain {
    display: flex;
    flex-direction: column;
    gap: 0; border-radius: 8px;
    overflow: hidden;
    flex: 0 0 auto;
}
.mediacommentchain.dimmed {
    opacity: 0.35;
    filter: grayscale(0.35);
    /* is it better to use ms over s? answer: Fuuckkkk i don't knowwww */
    transition: opacity 140ms ease, filter 140ms ease;
}
.mediacommentchain:not(.dimmed) {
    opacity: 1;
    filter: none;
}
.mediacommentchain .mediacomment {
    border: none;
    border-radius: 0;
}
.mediacommentchain .mediacomment:first-child {border-top: none}
.mediacomment.clickable {cursor: pointer}
.mediacomment.isreply {
    padding-left: calc(10px + 0.5em);
}

.mediacommentrow {
    display: grid; grid-template-columns: 28px 1fr;
    gap: 8px; align-items: start;
}

.mediacommentpfpwrap {
    position: relative; width: 28px;
    height: 28px;
}

.mediacommentpfp {
    width: 28px; height: 28px;
    border-radius: 50%; object-fit: cover;
    background: #0f1011; border: 1px solid rgba(255,255,255,0.08);
}

.mediacommentsource {
    position: absolute; right: -2px;
    bottom: -2px; width: 1em; height: auto; 
    background: black;
    border-radius: 50%;
}

.mediacommentmeta {
    display: flex; flex-direction: column;
    align-items: flex-start; gap: 2px;
    margin-bottom: 4px;
}

.mediacommentauthor {
    font-size: 12px; color: #eee;
    overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap;
}

.mediacommenttime {
    font-size: 11px; color: #9aa0a6;
    white-space: nowrap;
}

.mediacommenttext {
    font-size: 13px; color: #eee;
    word-break: break-word;
}

.mediacommentbody {
    max-height: 5.6em;
    overflow: auto;
}

/*//////////////////////////////////////////////////////////////////////*/

.commentcompose {
    width: 100%; height: 78px; resize: none;
    min-height: 78px; max-height: 78px;
    overflow: auto; font: inherit;
    color: #eee; background: rgba(0,0,0,0.18);
    border: 1px solid rgba(255,255,255,0.08); 
    border-radius: 10px 10px 10px 0;
    padding: 10px; outline: none;
}

.commentcomposerwrap {margin-top: 0}
.regioncomposer {
    position: sticky;
    bottom: 0; z-index: 3;
    background: #161719;
}

.commentcompose:focus {border-color: rgba(138,180,248,0.35)}
.commentcomposeactions {
    display: flex; justify-content: flex-start;
    gap: 0; margin-top: 0;
}
.commentpost {
    font: inherit; padding: 4px 8px 4px 8px;
    border-radius: 0 0 10px 10px; border: 1px solid rgba(138,180,248,0.25);
    background: rgba(138,180,248,0.10); color: #8ab4f8;
    cursor: pointer;
}
.commentpost:hover {background: rgba(138,180,248,0.16)}
.commentpost:disabled {opacity: 0.5; cursor: default}

/*//////////////////////////////////////////////////////////////////////*/

.discordloginbutton,
.discordlogout {
    font: inherit; padding: 8px 10px;
    border-radius: 8px; border: 1px solid rgba(138,180,248,0.25);
    background: rgba(138,180,248,0.08); color: #8ab4f8;
    cursor: pointer;
}
.discordloginbutton:hover,
.discordlogout:hover {
    background: rgba(138,180,248,0.14);
}
