:root {
    --button-primary: #000;
    --white: #ffffff;
    --black: #000000;
    --white: #ffffff;
    --red: #e74c3c;
    --grey-1: rgba(0, 0, 0, 0.03);
    --grey-2: rgba(0, 0, 0, 0.07);
    --grey-3: rgba(0, 0, 0, 0.1);
    --grey-4: rgba(0, 0, 0, 0.2);
    --grey-5: rgba(0, 0, 0, 0.3);
    --gap: 0.7rem;
    --outer-border-radius: 1.5rem;
    --inner-border-radius: 1rem;
    --max-width-narrow: 500px;
    --max-width-wide: 700px;
}

* {
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

html,
body {
    padding: 0;
    margin: 0;
    width: 100%;
    font-size: 11px;
}

@media only screen and (min-width: 360px) {

    html,
    body {
        font-size: 13px;
    }

    :root {
        --gap: 0.8rem;
    }
}

@media only screen and (min-width: 460px) {

    html,
    body {
        font-size: 15px;
    }

    :root {
        --gap: 1rem;
    }
}

@media only screen and (min-width: 560px) {

    html,
    body {
        font-size: 17px;
    }

    :root {
        --gap: 1.2rem;
    }
}

.app {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    scrollbar-gutter: stable both-edges;
    display: none;
    padding: calc(var(--gap) * 3) calc(var(--gap) * 1.5) calc(var(--gap) * 11) calc(var(--gap) * 1.5);
}

.app .content {
    width: 100%;
}

.app .header {
    display: block;
    width: 100%;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.shadow {
    border: 1px solid var(--grey-1);
    box-shadow: 0px 1px 1px var(--grey-3), 0px 1px 3px var(--grey-2), 0px 3px 7px var(--grey-1);
}

.error {
    color: var(--red);
    text-align: center;
    padding: 0;
    display: none;
}

.nav {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    border-radius: var(--outer-border-radius);
    overflow: hidden;
    z-index: 10;
    display: none;
    user-select: none;
}

.nav .items {
    padding: 0.5rem;
    background-color: var(--grey-3);
    backdrop-filter: blur(1rem);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.nav .item {
    width: 3.2rem;
    height: 3.2rem;
    border-radius: var(--inner-border-radius);
    display: flex;
    align-items: center;
    cursor: pointer;
    justify-content: center;
    background-color: transparent;
    transition: 0.3s ease;
}

.nav .item-center {
    background-color: var(--button-primary);
    border-radius: 3.5rem;
    padding: 0 2rem;
    height: 2.5rem;
}

.nav .item-center img {
    filter: invert(1);
}

.nav .item-selected {
    background-color: var(--grey-3);
}

.nav .item img {
    width: 1.3rem;
}

.nav .item:hover {
    opacity: 0.7;
}

.note {
    width: 100%;
    text-align: center;
    font-size: 1rem;
    color: #666;
}

/* MODAL */

.modal {
    display: none;
    position: fixed;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    top: 0;
    left: 0;
    z-index: 20;
}

.modal .bg {
    position: fixed;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    z-index: 15;
}

.modal .box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: var(--max-width-narrow);
    background-color: #fff;
    z-index: 30;
    border-radius: var(--outer-border-radius);
    padding: var(--gap);
}

.modal .header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: calc(var(--gap) * 2);
    font-weight: 700;
}

.modal .icon {
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 50%;
    background-color: var(--grey-2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.1s ease;
}

.modal .icon:hover {
    background-color: var(--grey-3);
}

.modal .icon img {
    width: 1.2rem;
    opacity: 0.5;
}

.modal .content {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
}

/* WRAPPER */

.wrapper {
    width: 100%;
    max-width: var(--max-width-wide);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    align-items: center;
    justify-content: center;
}

.wrapper-center {
    justify-content: center;
}

/* INPUT */

input,
select,
option {
    width: 100%;
    padding: 0 var(--gap);
    border-radius: var(--inner-border-radius);
    border: 1px solid var(--grey-3);
    font-size: 1rem;
    line-height: 3.5rem;
    height: 3.5rem;
    background-color: var(--grey-1);
}

label {
    width: 100%;
    display: block;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: var(--gap);
}

label img {
    transform: translateY(1px);
    width: 1rem;
    opacity: 0.7;
}

/* BUTTON */

button {
    width: 100%;
    padding: 0 var(--gap);
    border-radius: var(--inner-border-radius);
    border: 1px solid var(--grey-3);
    cursor: pointer;
    font-size: 1rem;
    transition: 0.1s ease;
    line-height: 3.5rem;
    height: 3.5rem;
    background-color: var(--button-primary);
    user-select: none;
    color: var(--white);
}

.button-danger {
    background-color: var(--red);
}

button:disabled {
    cursor: wait;
    opacity: 0.5;
}

button:hover {
    opacity: 0.9;
}

button:disabled:hover {
    opacity: 0.5;
}

.button-text {
    background: transparent;
    color: #666;
    border: 0;
}

.button-icon {
    width: auto;
    min-width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0);
    border: 1px solid rgba(0, 0, 0, 0);
    padding: 0;
    border-radius: 50%;
    background-size: 1.3rem 1.3rem;
    background-position: center;
    background-repeat: no-repeat;
}

.button-icon:hover {
    background-color: var(--grey-1);
    border: 1px solid var(--grey-1);
}

.button-icon img {
    width: 1rem;
}

/* LOADER */

.loader-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader {
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid var(--grey-5);
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

button .loader {
    border: 3px solid var(--white);
    border-bottom-color: transparent;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.seperator {
    width: 100%;
    max-width: 300px;
    height: 1px;
    background-color: var(--grey-4);
    margin: 1rem auto;
}

/* AUTH FORM */

.app-auth {
    padding: calc(var(--gap) * 3) calc(var(--gap) * 1.5) calc(var(--gap) * 3) calc(var(--gap) * 1.5);
}

.terms-notice {
    color: #777;
    position: absolute;
    bottom: 1rem;
    font-size: 0.7rem;
}

.terms-notice a {
    color: #777;
    font-size: 0.7rem;
}

.terms-notice a:hover {
    color: #555;
}

.auth-form {
    width: 100%;
    max-width: var(--max-width-narrow);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--gap);
    padding: calc(var(--gap) * 2) var(--gap) var(--gap) var(--gap);
    border-radius: var(--outer-border-radius);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.auth-form .header {
    font-size: 1.5rem;
    margin: 0 0 1rem 0;
}

.auth-form .item {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}

/* PROFILE */

.app-profile .items {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--gap);
}

.app-profile .items .item {
    width: 100%;
}

.app-profile .invites {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
}

.app-profile .invites .invite,
.app-profile .url {
    display: flex;
    gap: var(--gap);
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: calc(var(--gap) / 2) calc(var(--gap) / 2) calc(var(--gap) / 2) var(--gap);
    border-radius: var(--outer-border-radius);
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 1rem;
    background-color: var(--grey-1);
}

.app-profile .invites .invite .icon {}

/* CHANNEL */
.app-channels .wrapper .content {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    --cols: 2;
    width: 100%;
    gap: var(--gap);
}

@media only screen and (min-width: 600px) {
    .app-channels .wrapper .content {
        --cols: 3;
    }
}

.app-channels .wrapper .content .channel {
    position: relative;
    padding-top: 40%;
    background-color: var(--grey-3);
    border-radius: var(--outer-border-radius);
    border: 1px solid var(--grey-1);
    flex-basis: calc(100% / var(--cols) - var(--gap) / var(--cols) * (var(--cols) - 1));
    flex-grow: 1;
    height: 13rem;
    cursor: pointer;
    transition: 0.1s ease;
    user-select: none;
    pointer-events: auto;
}

.app-channels .wrapper .content .channel:hover {
    opacity: 0.9;
    box-shadow: 0px 1px 2px var(--grey-3);
    transform: translateY(-1px);
}

.app-channels .wrapper .content .channel:active {
    transform: translateY(1px);
}

.app-channels .wrapper .content .channel-disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: wait;
}

.app-channels .wrapper .content .channel-disabled:hover {
    opacity: 0.5;
}

.app-channels .wrapper .content .channel .title {
    position: absolute;
    top: 0;
    left: 0;
    padding: var(--gap);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 85%;
    text-transform: uppercase;
    font-size: 1rem;
    color: #333;
    /* text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1); */
    font-weight: 700;
    word-break: break-word;
}

.app-channels .wrapper .content .channel .icon {
    position: absolute;
    top: var(--gap);
    right: var(--gap);
    width: 1.3rem;
    opacity: 0.8;
}

/* CHANNEL FULL */

.channel-full {
    width: 100%;
}

.channel-full .header {
    position: sticky;
    z-index: 1;
    top: var(--gap);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--gap);
    padding: calc(var(--gap) * 0.75);
    border-radius: var(--outer-border-radius);
    background-color: var(--grey-2);
    border: 1px solid var(--grey-2);
    backdrop-filter: blur(1rem);
}

.channel-full .header .name {
    white-space: nowrap;
    text-overflow: ellipsis;
    text-transform: uppercase;
    overflow: hidden;
    font-weight: 700;
}

.channel-full .header .actions {
    position: relative;
}

.channel-full .channel-menu {
    position: absolute;
    top: 100%;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 0;
    padding: calc(var(--gap) * 0.5);
    border-radius: var(--outer-border-radius);
    border: var(--grey-1);
    background-color: var(--white);
    z-index: 20;
}

.channel-full .channel-menu-show {
    display: flex;
}

.channel-full .channel-menu .button {
    background-color: transparent;
    color: var(--black);
    white-space: nowrap;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--gap);
    height: 3rem;
    line-height: 3rem;
}

.channel-full .channel-menu .button img {
    width: 1rem;
}

.channel-full .channel-menu .button:hover {
    background-color: var(--grey-2);
    border: 1px solid var(--grey-2);
}

.channel-full .header .left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    max-width: 75%;
    gap: var(--gap);
}

.channel-full .header .actions button {
    width: auto;
}

.channel-full .sources {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    gap: var(--gap);
}

.channel-full .sources .wrapper {
    height: 100%;
}

/* SOURCE */

.search-source-results {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    display: none;
}

.search-source-results .loader,
.search-source-results .note {
    margin: var(--gap) 0;
}

.source {
    width: 100%;
    height: fit-content;
    border: 1px solid var(--grey-2);
    border-radius: var(--outer-border-radius);
    padding: var(--gap);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--gap);
    background-color: var(--grey-2);
}

.sources .source button .loader {
    border: 3px solid var(--grey-5);
    border-bottom-color: transparent;
}

.search-source-results .source {
    border-radius: var(--inner-border-radius);
}

.search-source-results .source button {
    background-color: #000;
}

.source .thumbnail {
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.source .thumbnail img {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.source .info {
    width: 40%;
}

.source .info .title {
    font-size: 1rem;
    color: var(--black);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.source .info .handle {
    font-size: 0.9rem;
    color: #888;
}

.source button {
    margin-left: auto;
    border-radius: 50%;
}