@font-face {
    font-family: "Cordata PPC-400";
    src: url("../WebPlus_Cordata_PPC-400.woff") format("woff");
    font-display: swap;
}

:root {
    --bg: #0e163a;
    --head: #1a2a60;
    --text: #fcf7fd;
    --accent: #7a9eec;
    --muted: #a9b6d9;
    --line: #34457f;
    --field: #0a1030;

    --band-from: var(--head);
    --band-to: var(--bg);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: "Cordata PPC-400", Tahoma, Verdana, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--accent); }

a:hover {
    background: var(--accent);
    color: var(--bg);
    text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 16px;
}

.muted { color: var(--muted); }

.bbs-head {
    position: relative;
    background: var(--head);
    padding-bottom: 40px;
    text-align: center;
}

.bbs-head::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 40px;
    background: var(--dither-band, var(--bg)) repeat-x 0 0 / 16px 40px;
    image-rendering: pixelated;
}

.bbs-top {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 14px;
}

.bbs-top a { text-decoration: none; }

.bbs-logo {
    display: inline-block;
    margin: 18px 0 8px;
    font-size: clamp(2.2rem, 9vw, 4.2rem);
    line-height: 1.1;
    color: var(--text);
    text-decoration: none;
}

.bbs-logo:hover { background: none; color: var(--accent); }

.bbs-boards {
    margin: 0 0 6px;
    font-size: 17px;
    color: var(--muted);
}

.bbs-boards a.active {
    background: var(--accent);
    color: var(--bg);
    text-decoration: none;
}

main.wrap { padding-top: 24px; padding-bottom: 32px; }

.bbs-lead {
    margin: 0 0 20px;
    text-align: center;
}

.board-index {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--line);
}

.board-index li {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr) auto;
    gap: 6px 16px;
    align-items: baseline;
    padding: 12px 4px;
    border-bottom: 1px solid var(--line);
}

.board-link { font-size: 18px; font-weight: bold; }

.board-index p { margin: 2px 0 0; font-size: 14px; }

.board-count { font-size: 13px; white-space: nowrap; }

.bbs-stats {
    margin: 18px 0 0;
    text-align: center;
    font-size: 13px;
}

.bbs-title { margin-bottom: 16px; }

.bbs-title h1 {
    margin: 0;
    font-size: 26px;
    font-weight: normal;
}

.bbs-title p { margin: 4px 0 0; }

.new-thread { margin-bottom: 20px; }

.new-thread > summary {
    width: fit-content;
    color: var(--accent);
    cursor: pointer;
    list-style: none;
}

.new-thread > summary::-webkit-details-marker { display: none; }
.new-thread > summary:hover { background: var(--accent); color: var(--bg); }
.new-thread[open] > summary { margin-bottom: 12px; }

.thread-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--line);
}

.thread-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 14px;
    padding: 9px 4px;
    border-bottom: 1px solid var(--line);
}

.thread-link {
    flex: 1 1 280px;
    min-width: 0;
    font-weight: bold;
}

.thread-server { font-size: 13px; }

.thread-meta {
    font-size: 13px;
    white-space: nowrap;
}

.flag {
    margin-right: 4px;
    font-weight: normal;
    color: var(--muted);
}

.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 16px;
}

.empty { margin: 18px 0; }

.crumbs { margin: 0 0 14px; font-size: 14px; }

.bbs-thread {
    display: grid;
    gap: 4px;
}

.bbs-post {
    padding: 3px 10px 4px;
    border-left: 2px solid var(--line);
    line-height: 1.4;
}

.bbs-post.op {
    padding-left: 0;
    padding-bottom: 8px;
    margin-bottom: 4px;
    border-left: none;
    border-bottom: 1px solid var(--line);
}

.bbs-post.op .post-body,
.bbs-post.op .server-card {
    margin-top: 8px;
}

.bbs-post:target,
.bbs-post.flash {
    border-left-color: var(--accent);
    background: rgba(122, 158, 236, 0.1);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 10px;
    font-size: 13px;
}

.post-subject {
    font-size: 17px;
    color: var(--text);
}

.post-no { text-decoration: none; }

.post-body {
    margin-top: 1px;
    overflow-wrap: anywhere;
}

.post-body .quote { color: #9fd18b; }

.post-body .ref { text-decoration: none; }

.server-card {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0 14px;
    width: fit-content;
    max-width: 100%;
    margin: 4px 0;
    padding: 6px 10px;
    border: 1px dashed var(--line);
    font-size: 14px;
}

.server-card dt { color: var(--muted); }
.server-card dd { margin: 0; overflow-wrap: anywhere; }

.status {
    display: inline-block;
    padding: 0 5px;
    border: 1px solid var(--line);
    font-size: 12px;
    white-space: nowrap;
}

.status.on {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--bg);
}

.bbs-form {
    margin-top: 22px;
    padding: 12px;
    border: 1px solid var(--line);
}

.bbs-form .field { margin-bottom: 10px; }

.bbs-form label {
    display: block;
    margin-bottom: 3px;
    font-size: 14px;
    color: var(--muted);
}

.bbs-form input,
.bbs-form textarea {
    width: 100%;
    padding: 6px 8px;
    font: inherit;
    color: var(--text);
    background: var(--field);
    border: 1px solid var(--line);
}

.bbs-form input[name="captcha"] { width: 6em; }

.bbs-form textarea { min-height: 110px; resize: vertical; }

.bbs-form button {
    padding: 6px 14px;
    font: inherit;
    font-weight: bold;
    color: var(--bg);
    background: var(--accent);
    border: 1px solid var(--accent);
    cursor: pointer;
}

.bbs-form button:hover { background: var(--text); border-color: var(--text); }

.hint { margin: 0 0 10px; font-size: 13px; }

.hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.errorlist {
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
    color: #ff9a9a;
    font-size: 14px;
}

.errorlist.nonfield { margin: 0 0 10px; }

.rules { padding-left: 22px; }
.rules li { margin-bottom: 6px; }

.bbs-foot {
    padding-top: 16px;
    padding-bottom: 32px;
    border-top: 1px solid var(--line);
    text-align: center;
    font-size: 13px;
    color: var(--muted);
}

@media (max-width: 560px) {
    .board-index li { grid-template-columns: 70px minmax(0, 1fr); }
    .board-count { grid-column: 2; }
    .bbs-post { padding-right: 4px; }
}

.backlinks {
    margin-top: 2px;
    font-size: 12px;
}

.backlinks .ref { margin-right: 4px; }

.ref-preview {
    position: absolute;
    z-index: 20;
    max-width: min(560px, calc(100vw - 16px));
    padding: 4px 10px 6px;
    background: var(--head);
    border: 1px solid var(--accent);
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.45);
    pointer-events: none;
}

.ref-preview .bbs-post {
    padding: 0;
    border: none;
    margin: 0;
    background: none;
}

.ref-preview .server-card { display: none; }

.hotkeys { display: none; }