:root {
    --bg: #0f1720;
    --panel: #111827;
    --muted: #94a3b8;
    --accent: #60a5fa;
    --card: #0b1220;
    --card_rows: 3;
    --card_cols: 6;
    /* --card_size: calc((100vh - 150px) / var(--card_rows) - 1rem); */
    --card_size: 170px;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial;
}
body {
    margin: 0;
    background: linear-gradient(180deg, #091018 0%, #07101a 100%);
    color: #e6eef8;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    font-size: 1rem;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
}
.container {
    padding: 0;
    width: 100%;
    overflow: hidden;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.footer {
    padding: 0.5rem;
    color: var(--muted);
    font-size: 0.75rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    width: 100%;
}
.app {
    display: flex;
    gap: 20px;
    width: fit-content;
    margin: 0 auto;
    padding: 12px;
    height: fit-content;
}
.sidebar {
    width: fit-content;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.5rem;
    /* padding: 12px; */
    height: 100%;
    min-width: 160px;
}
.main {
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: fit-content;
    min-height: 0;
    height: 100%;
}
.controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    flex: 1;
}
.sorting-options {
    display: flex;
    flex-direction: row;
    gap: 0.25rem;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    padding: 0 0.5rem;
}
.sort-state-button {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 6px 10px;
    border-radius: 8px;
    color: inherit;
    cursor: pointer;
    transition: 0.3s;
    user-select: none;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}
.search-bar {
    flex: 1;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    background: rgba(255, 255, 255, 0.02);
    margin: 0.5rem;
    color: inherit;
}

.grid {
    padding: 1rem;
    display: grid;
    gap: 1rem;
    align-items: flex-start;
    min-height: 0;
    overflow: hidden;
    width: fit-content;
    grid-template-columns: repeat(auto-fit, minmax(var(--card_size), var(--card_size)));
    grid-template-rows: repeat(auto-fit, minmax(var(--card_size), var(--card_size)));

    min-width: calc(6 * var(--card_size) /* 6 columns */ + 5 * 1rem /* 5 gaps between them */ + 2 * 1rem /* padding-left + padding-right */);
    min-height: calc(3 * var(--card_size) /* 3 rows */ + 2 * 1rem /* padding-top + padding-bottom */ + 2 * 1rem /* pagination controls */);
}
.slot {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.02);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}
.trophy-slot-inner-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.trophy-slot-img {
    border-radius: 8px;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
}

.trophy-slot-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    z-index: 2;
    pointer-events: none;
}

.trophy-slot-text {
    color: whitesmoke;
    text-align: center;
    margin-top: 0px;
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 4px;
    border-radius: 4px;
}

.label {
    font-weight: 700;
}
.progress-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    width: 100%;
    padding-left: 12px;
}
.bar {
    flex: 1;
    height: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    overflow: hidden;
}
.bar > i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #82baff, #0062ff);
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
#progress-text {
    font-size: 12px;
    color: var(--muted);
    width: max-content;
    text-align: justify;
}
.panel {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
}
/* .right {
    width: 260px;
    display: flex;
    flex-direction: column;
}
.right {
    width: 260px;
    display: flex;
    flex-direction: column;
}
.right {
    width: 260px;
    display: flex;
    flex-direction: column;
    gap: 12px;
} */
textarea {
    width: 100%;
    height: 120px;
    border-radius: 8px;
}
.small {
    font-size: 12px;
    color: var(--muted);
}
.muted {
    color: var(--muted);
}
a.muted:hover {
    color: whitesmoke;
}
.locked {
    filter: brightness(0.5);
}
input.hidden {
    display: none;
}
/* #mediaInput {
    opacity: 0;
    position: absolute;
    left: 0;
    top: 0;
    width: 0px;
    height: 0px;
    z-index: 2;
    pointer-events: all;
} */
.upload-save-file {
    position: relative;
    display: inline-block;
    overflow: hidden;
    width: 100%;
    text-align: center;
}
#mediaInputLabel {
    appearance: none;
    /* border: none; */
    /* color: #fff; */
    font-weight: 600;
    cursor: pointer;
    max-width: 100%;
    display: inline-block;
    width: 100%;
    /* outline: none; */
    text-decoration: none;
}
.trophy-slot {
    display: inline-block;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    text-align: center;
    vertical-align: top;
    box-sizing: border-box;
    transition: 0.3s;
    width: var(--card_size);
    height: var(--card_size);
    cursor: pointer;
}
.trophy-slot.owned-true {
    --color: rgb(40, 189, 26);
    border: 3px solid var(--color);
    box-shadow: 0 0 3px 1px var(--color);
}
.trophy-slot.owned-false {
    border: 3px solid rgba(255, 255, 255, 0.3);
}
.trophy-slot.owned-true > div > img {
    background: transparent;
    filter: none;
}
.trophy-slot.owned-false > div > img {
    filter: grayscale(60%) brightness(0.5);
}
.trophy-slot:hover {
    transform: scale(1.03);
}
.trophy-slot > div {
    width: 100%;
    height: 100%;
    margin: 0 auto 8px auto;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.trophy-slot > div > img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    transition: 0.3s;
}
.top-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    justify-content: space-between;
}
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    width: max-content;
    min-width: fit-content;
    min-height: fit-content;
    user-select: none;
}
.pagination-controls button {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 6px 12px;
    border-radius: 8px;
    color: inherit;
    cursor: pointer;
    transition: 0.3s;
    user-select: none;
}
.pagination-controls button:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.06);
}
.pagination-controls button:disabled {
    background: rgba(255, 255, 255, 0.01);
    border-color: rgba(255, 255, 255, 0.02);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}
.pagination-controls span {
    font-size: 13px;
    color: var(--muted);
    width: max-content;
    user-select: none;
}
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.modal-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    width: 100%;
    height: 100vh;
    height: max-content;
}
.modal-content {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 90%;
    max-width: 1200px;
    min-height: calc(var(--card_size) * 3 + 1rem * 2 + 100px);
    max-height: 90vh;
    overflow: hidden;
    position: relative;
}
.modal-card {
    display: inline-block;
    width: 180px;
    height: 180px;
    border-radius: 8px;
    text-align: center;
    vertical-align: top;
    box-sizing: border-box;
    transition: 0.3s;
    border: 3px solid var(--color);
}
.category {
    font-size: 1.2rem;
    position: relative;
    /* background: rgba(255, 255, 255, 0.03); */
    padding: 0.5rem 1rem;

    cursor: pointer;
    transition: background 0.3s;
    will-change: transform;
    color: whitesmoke;
    z-index: 100;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.category:first-child {
    border-top: none;
    border-radius: 0.5rem 0.5rem 0 0;
}
.category:first-child:hover {
    border-radius: 0.5rem 0 0 0;
}
.category:last-child {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.category:hover {
    background: rgb(29, 33, 44);
}

.sub {
    position: absolute;
    top: 0;
    left: 100%;
    background: #10171f;
    border-radius: 0 0.5rem 0.5rem 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 200px;

    opacity: 0;
    transform: translateX(-10px);
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 100;
}

.category:hover .sub {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* .sub div {
      padding: 10px 15px;
      transition: background 0.2s;
      white-space: nowrap;
    } */

/* .sub div:hover {
      background: #555;
    } */
.tabs {
    display: flex;
    flex-direction: column;
    /* gap: 10px; */
    border-radius: 0.5rem;
}
.tab {
    padding: 0.5rem 1rem;
    /* border-radius: 8px; */
    cursor: pointer;
    text-align: center;
    background: transparent;
    /* border: 1px solid rgba(255, 255, 255, 0.03); */
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    transition: 0.3s;
    color: whitesmoke;
    will-change: transform;
}
.tab:first-child {
    border: none;
}
.tab:hover {
    background: rgb(29, 33, 44);
    /* border-color: rgba(255, 255, 255, 0.05); */
    transform: scale(1.05);
}
.tab.active {
    background: linear-gradient(90deg, rgba(96, 165, 250, 0.14), rgba(60, 99, 255, 0.06));
    border-color: rgba(96, 165, 250, 0.2);
}
#share-link-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    /* display: flex; */
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}
#share-link-box {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}
#share-link-text {
    font-size: 1.2rem;
    color: whitesmoke;
}
#share-link-input {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    background: rgba(255, 255, 255, 0.02);
    color: inherit;
    font-size: 1rem;
}
#copy-share-link-btn,
#close-share-link-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 8px 16px;
    border-radius: 8px;
    color: inherit;
    cursor: pointer;
    transition: 0.3s;
    user-select: none;
    font-size: 1rem;
    font-weight: 600;
}
#interaction-lock {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    z-index: 10000;
    overflow: hidden;
}
