body {
    margin: 0;
    background-color: #181818;
    background-image: linear-gradient(to bottom, rgba(24, 24, 24, 0.8) 0%, rgba(24, 24, 24, 0.8) 52%, rgba(24, 24, 24, 0.85) 59%, rgba(24, 24, 24, 0.93) 66%, #181818 88%, #181818 100%), url("https://39chan.moe/back.webp");
    background-repeat: no-repeat;
    background-position: center top;
    background-size: 100% 100%, cover;
    background-attachment: fixed;
    color: #ddd;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    font-size: 11px;
    line-height: 1.3;
}

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

a:hover {
    text-decoration: underline;
}

header {
    padding: 5px 15px 0;
    background: #181818 url("https://39chan.moe/items/headerbg.png") left center / auto 100% repeat-x;
}

header img {
    display: block;
    height: 150px;
    max-width: 100%;
    object-fit: contain;
    object-position: left;
}

nav {
    display: flex;
    flex-wrap: wrap;
    background: linear-gradient(135deg, #ff2ea6, #b3006e);
    border-bottom: 1px solid #7a004a;
}

.tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    color: #fff;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.tab i {
    font-size: 12px;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.12);
    text-decoration: none;
}

.tab.active {
    background: rgba(0, 0, 0, 0.2);
    box-shadow: inset 0 -2px 0 #fff;
}

.wrap {
    max-width: 1500px;
    margin: 10px auto;
    padding: 0 10px;
}

.footer {
    text-align: center;
    padding: 15px;
    color: #999;
    margin-top: 15px;
}

.footer p {
    margin: 0;
}

.footer a:hover {
    text-decoration: none;
}

.links {
    margin-bottom: 6px;
}

.links a {
    color: #999;
    margin: 0 5px;
}

.links a:hover {
    color: #ff009c;
}

.box {
    margin-bottom: 10px;
    background-color: #181818;
    border: 1px solid #333;
}

.box-title {
    padding: 4px 8px;
    background: linear-gradient(#292929 0%, #282828 18%, #262626 45%, #242424 65%, #1f1f1f 100%);
    border-bottom: 1px solid #333;
    text-shadow: 0 -1px 0 #181818;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.box-body {
    padding: 8px;
}

.back {
    display: block;
    padding: 6px 8px;
    background: linear-gradient(#292929 0%, #282828 18%, #262626 45%, #242424 65%, #1f1f1f 100%);
    border: 1px solid #333;
    color: #ddd;
    font-size: 10px;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.back:hover {
    text-decoration: none;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 130px);
    gap: 8px;
    padding: 8px;
}

.item {
    display: flex;
    flex-direction: column;
    border: 1px solid #333;
    color: #ddd;
    font-weight: bold;
}

.item:hover {
    text-decoration: none;
}

.item img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: #101010;
    border-bottom: 1px solid #333;
    filter: grayscale(100%);
}
.item:hover img {
    filter: none;
}

.item span {
    padding: 6px;
    overflow-wrap: anywhere;
}

.home {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 10px;
    align-items: start;
}

.character {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr) 300px;
    gap: 10px;
    align-items: start;
}

.character .side .box-body {
    background: #101010;
}

.portrait {
    display: block;
    max-width: 100%;
    margin: 0 auto;
}

.portrait[hidden] {
    display: none;
}

.gallery .box-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.arrows {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #999;
    font-weight: normal;
}

.arrow {
    width: 14px;
    height: 14px;
    line-height: 14px;
    border: 1px solid #333;
    color: #999;
    font-size: 8px;
    text-align: center;
}

.arrow:hover {
    text-decoration: none;
}

h1 {
    margin: 0 0 8px;
    font-size: 13px;
}

h3 {
    margin: 8px 0 4px;
    font-size: 11px;
}

p {
    margin: 0 0 8px;
}

.box-body p:last-child {
    margin-bottom: 0;
}

.logo {
    display: block;
    width: 320px;
    max-width: 100%;
    margin: 4px auto 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

td {
    padding: 5px 8px;
    border-top: 1px solid #333;
    vertical-align: middle;
}

td:first-child {
    width: 140px;
    color: #999;
}

.files td:first-child {
    width: auto;
    color: #ddd;
    font-weight: bold;
}

.files td + td {
    width: 1%;
    padding-left: 0;
    white-space: nowrap;
}

.files tr:first-child td {
    border-top: 0;
}

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

.columns table tr:first-child td {
    border-top: 0;
}

.btn {
    display: inline-block;
    padding: 2px 6px;
    border: 1px solid #333;
    color: #999;
    font-size: 10px;
}

.btn:hover {
    text-decoration: none;
}

@media (max-width: 1100px) {
    .character {
        grid-template-columns: 320px minmax(0, 1fr);
    }

    .character aside {
        grid-column: 1 / -1;
    }
}

@media (max-width: 800px) {
    .home,
    .character,
    .columns {
        grid-template-columns: 1fr;
    }
}
