:root {
    --bg: #000000;
    --fg: rgb(238, 238, 238);
    --border: rgb(60, 120, 149);
    --subtle: rgb(145, 125, 170);
    --links: rgb(65, 95, 173);
}

#spa-loading {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translate(-50%, -120%);
    padding: 8px 12px;
    background: rgba(15, 15, 15, 0.9);
    color: #f0f0f0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    font-family: 'MainRegular', monospace;
    font-size: 12px;
    letter-spacing: 0.5px;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.2s ease;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

#spa-loading.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.ascii-scale-container {
        width: 100%;
        overflow-x: auto;
        display: block;
        position: relative;
}

.ascii-scale-inner {
        display: inline-block;
        width: auto;
        max-width: 100%;
}

@media (max-width: 700px) {
    .ascii-scale-container {
        /* Ensure container doesn't overflow */
        max-width: 100vw;
    }
    .ascii-scale-inner {
        width: 100%;
        max-width: 100vw;
    }
    #ascii,
    #ascii-time {
        display: block;
        max-width: 100vw;
        width: 100%;
        /* Responsive scale: shrink to fit if needed */
        font-size: 3vw;
    }
}
@font-face {
    font-family: 'MainRegular';
    src: url('resources/IosevkaFixedSS03-Regular.woff2');
}

@font-face {
    font-family: 'MainBold';
    src: url('resources/IosevkaFixedSS03-Bold.woff2');
}

@font-face {
    font-family: 'MainItalic';
    src: url('resources/IosevkaFixedSS03-Italic.woff2');
}

@font-face {
    font-family: 'MainBoldItalic';
    src: url('resources/IosevkaFixedSS03-BoldItalic.woff2');
}

@font-face {
    font-family: 'IBM_VGA';
    src: url('resources/IBM_VGA.woff');
}

#ascii,
#ascii-time {
    font-family: 'IBM_VGA', monospace;
    font-size: clamp(8px, 4vw, 12px);
    white-space: pre;
    overflow-wrap: normal;
    word-wrap: normal;
    display: block;
    max-width: 100%;
    width: max-content;
    margin: 0 auto;
    transition: font-size 0.2s;
}

#ascii-time {
    line-height: 0.9;
}

#ascii-time-label {
    display: block;
    text-align: center;
    margin: 0 auto;
}

#usage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    align-items: start;
    margin: 0 auto;
}

body.mobile-template #usage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.usage-card {
    text-align: center;
}

body.mobile-template .usage-card {
    min-width: 0;
}

.usage-ascii {
    font-family: 'IBM_VGA', monospace;
    font-size: 11px;
    white-space: pre;
    color: #a6a6a6;
    text-shadow: 0 0 10px #222;
    margin: 0 auto;
}

.usage-label {
    margin-top: 6px;
    font-size: 12px;
    color: #777;
    font-family: 'MainRegular', monospace;
}

body.mobile-template .usage-ascii {
    display: block;
    width: max-content;
    max-width: 100%;
    margin: 0 auto;
}

@media (max-width: 420px) {
    body.mobile-template #usage-grid {
        gap: 10px;
    }
}

.ascii-scale-container {
    width: 100%;
    overflow-x: auto;
    display: block;
    position: relative;
}

.ascii-scale-inner {
    display: inline-block;
    width: auto;
    max-width: 100%;
}

/* Animatable angle for rotating text gradients */
@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes rotate-gradient {
    to { --angle: 360deg; }
}

.spoiler {
    background-color: var(--fg);
    color: transparent;
    cursor: help;
    transition: color 0.2s;
}

.spoiler:hover {
    color: var(--fg);
    background-color: transparent;
}

body {
    background-color: var(--bg);
    color: var(--fg);
    font-family: 'MainRegular', monospace;
    font-size: 15px;
    margin: 0;
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
}

#page-wrapper {
    display: flex;
    width: 100vw;
    height: 100dvh;
}

#sidebar {
    width: 20%;
    min-width: 150px;
    max-width: 200px;
    height: 100%;
    border-right: 1px solid var(--border);
    box-sizing: border-box;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* allow sidebar content to scroll if taller than viewport */
}

#container {
    display: flex;
    height: 100%;
    width: 100%;
    overflow-y: scroll;
}

#content {
    flex: 1;
    min-width: 0;
    height: 100%;
    box-sizing: border-box;
    padding: 26px;
    max-width: 620px;
    white-space: normal;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

#content-layout {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

#content-main {
    min-height: 0;
}

#sidebar a {
    text-decoration: none;
    display: block;
    position: relative;
}

#header {
    border-bottom: 1px solid var(--border);
    padding-top: 16px;
    padding-left: 16px;
    padding-bottom: 24px;
    flex-shrink: 0;
}

#title {
    font-family: "MainBoldItalic", monospace;
    cursor: default;
    background-image: linear-gradient(0deg, #977eb6, #86d3cf);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

#subtitle {
    font-family: "MainItalic", monospace;
    font-size: 11px;
    color: var(--subtle);
    margin-top: 4px;
    cursor: default
}

#hide-sidebar {
    cursor: pointer;
    color: var(--subtle);
    font-size: 12px;
}

#hide-sidebar:hover {
    color: rgb(48, 90, 173);
}

#show-sidebar {
    position: fixed;
    top: 8px;
    left: 8px;
    cursor: pointer;
    color: var(--subtle);
    font-size: 12px;
    z-index: 100;
}

#show-sidebar:hover {
    color: rgb(48, 90, 173);
}

@media (max-width: 700px) {
    #show-sidebar {
        font-size: 16px;
        border-radius: 6px;
    }
}

.tooltip {
    position: fixed;
    background-color: rgba(0, 0, 0, 0.9);
    color: var(--fg);
    padding: 4px 8px;
    border: 1px solid rgb(48, 90, 173);
    border-radius: 4px;
    font-size: 12px;
    white-space: pre-line;
    word-wrap: break-word;
    text-align: left;
    z-index: 10;
    pointer-events: none;
}

#content [data-tooltip]:not(a) {
    cursor: help;
}

.bbcode-btn[data-tooltip],
.bbcode-dropdown[data-tooltip],
button[data-tooltip] {
    cursor: pointer !important;
}

#sidebar [data-tooltip] {
    cursor: pointer;
}

[data-tooltip].tooltip-right:hover::after {
    left: auto;
    right: 0;
    transform: none;
}

#tab {
    font-family: "MainRegular", monospace;
    padding: 8px;
    border-bottom: 1px solid var(--border);
    color: var(--fg);
    flex-shrink: 0;
}

#tab.active {
    background-color: var(--subtle);
    color: var(--bg);
}

#tab.active:hover {
    background-color: var(--subtle);
    color: var(--bg);
    cursor: default;
}

#user-greeting {
    font-family: "MainItalic", monospace;
    font-size: 12px;
    color: var(--subtle);
    padding: 8px;
    flex-shrink: 0;
}

#tab:hover {
    background-color: rgb(30, 30, 30);
    cursor: pointer;
}

#sidebar-spacer {
    margin-top: auto;
}

#sidebar-footer {
    width: 100%;
    padding: 18px 8px 12px 8px;
    box-sizing: border-box;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

#mini-player-tracks {
    width: 100%;
    padding: 10px 8px 8px 8px;
    box-sizing: border-box;
    border-top: 1px solid var(--border);
    display: none; /* shown only when populated via JS */
    flex-direction: column;
    gap: 4px;
    max-height: 140px; /* fixed pixel max-height, sidebar itself scrolls if needed */
    overflow-y: auto;
    flex-shrink: 0; /* keep row height consistent; do not vertically squash when viewport shrinks */
}

.mini-track {
    font-size: 11px;
    font-family: "MainRegular", monospace;
    color: rgba(200, 200, 200, 0.9);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-track:hover {
    color: var(--fg);
}

.mini-track.active {
    color: var(--fg);
    font-family: "MainBold", monospace;
}

#mini-player {
    width: 100%;
    padding: 10px 8px 6px 8px;
    box-sizing: border-box;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 140px; /* when content exceeds this, it scrolls instead of stretching */
    overflow-y: auto;
    flex-shrink: 0; /* don't let the track list height compress when the window gets shorter */
    margin-bottom: 12px
}

#mini-player.mini-inactive {
    display: none;
}

#mini-player-main {
    display: flex;
    align-items: center;
    gap: 8px;
}

#mini-player-art-wrapper {
    position: relative;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    margin-top: 5px;
    align-self: center;
}

#mini-player-art {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center center;
    background-color: #111;
    border: 1px solid #444;
}

#mini-player-art-wrapper #mini-player-download {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    cursor: pointer;
}

#mini-player.is-playing #mini-player-art-wrapper:hover #mini-player-download {
    opacity: 1;
    pointer-events: auto;
}

#mini-player-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#mini-player-title {
    overflow: hidden;
}

#mini-player-title-inner {
    display: inline-block;
    font-size: 11px;
    font-family: "MainItalic", monospace;
    color: var(--subtle);
    white-space: nowrap;
    text-overflow: ellipsis;
    --scroll-distance: 0px;
}

#mini-player-title-inner.scrolling {
    text-overflow: clip;
    animation: mini-player-title-scroll 10s ease-in-out infinite alternate;
}

@keyframes mini-player-title-scroll {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(calc(-1 * var(--scroll-distance)));
    }
}

#mini-player-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

#mini-player-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

#mini-player-seek {
    width: 100%;
}

#mini-player-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    font-size: 13px;
}

#mini-player-controls span,
#mini-player-play {
    cursor: pointer;
    color: rgba(200, 200, 200, 0.9);
}

#mini-player-controls span:hover,
#mini-player-play:hover {
    color: rgb(255, 255, 255);
}

#mini-player-volume-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
}

#mini-player-volume {
    width: 0;
    opacity: 0;
    transition: width 0.15s ease, opacity 0.15s ease;
}

#mini-player-volume-wrapper:hover #mini-player-volume {
    width: 60px;
    opacity: 1;
}

/* Mini player sliders: match site aesthetic */
#mini-player-seek,
#mini-player-volume {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #111;
    border: 1px solid #444;
    border-radius: 3px;
}

#mini-player-seek::-webkit-slider-thumb,
#mini-player-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background: var(--fg);
    border: 1px solid #888;
}

#mini-player-seek::-moz-range-track,
#mini-player-volume::-moz-range-track {
    height: 4px;
    background: #111;
    border: 1px solid #444;
    border-radius: 3px;
}

#mini-player-seek::-moz-range-thumb,
#mini-player-volume::-moz-range-thumb {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background: var(--fg);
    border: 1px solid #888;
}

#mini-player-seek:focus,
#mini-player-volume:focus {
    outline: none;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
}

/* Make volume slider more compact (same visual height as play icon) */
#mini-player-volume {
    height: 3px;
}

#mini-player-volume::-moz-range-track {
    height: 3px;
}

#mini-player-volume::-webkit-slider-thumb,
#mini-player-volume::-moz-range-thumb {
    width: 8px;
    height: 8px;
}

#footer-text {
    font-size: 12px;
    font-family: "MainItalic", monospace;
    color: var(--subtle);
    display: block;
    text-align: center;
    margin-bottom: 12px;
}

#content-footer {
    margin-top: auto;
    padding-top: 12px;
    text-align: center;
}

#content.content-scrolls #content-footer {
    margin-top: 24px;
    margin-bottom: 26px;
}

#content-footer-views {
    font-size: 12px;
    font-family: "MainItalic", monospace;
    color: #67676754;
}

/* Scrollbar theming */
* {
    scrollbar-width: thin;
    scrollbar-color: #a9a9a9 #0a0a0a;
}

*::-webkit-scrollbar {
    width: 10px;
}

*::-webkit-scrollbar-track {
    background: #0a0a0a;
}

*::-webkit-scrollbar-thumb {
    background: #2c2c2c;
    border: 1px solid #a9a9a9;
    border-radius: 6px;
}

*::-webkit-scrollbar-thumb:hover {
    background: #3a3a3a;
}

#footer-buttons {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    align-items: stretch;
    width: 100%;
}

#footer-buttons a {
    flex: 1;
    display: flex;
    row-gap: 5px;
}

#footer-button {
    font-family: "MainRegular", monospace;
    font-size: 12px;
    color: var(--fg);
    background-color: var(--bg);
    border: 1px solid var(--border);
    padding: 4px 8px;
    text-decoration: none;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    border-radius: 2px;
}

#footer-button:hover {
    background-color: rgb(30, 30, 30);
    cursor: pointer;
}

#footer-button.active {
    background-color: rgb(255, 255, 255);
    color: var(--bg);
    cursor: default;
}

body.mobile-template #footer-buttons {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    align-items: center;
}

body.mobile-template #footer-buttons > a.mobile-footer-link {
    min-width: 0;
    display: block !important;
    flex: 0 0 auto !important;
    text-decoration: none;
}

body.mobile-template #footer-buttons > a.mobile-footer-link > #footer-button.mobile-footer-button {
    width: 100%;
    min-height: 30px;
    padding: 6px 0;
    border-radius: 0;
    background-color: #000000;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1;
    box-sizing: border-box;
}

body.mobile-template #footer-buttons > a.mobile-footer-link > #footer-button.mobile-footer-button i {
    font-size: 12px;
    line-height: 1;
}

body.mobile-template #footer-buttons > a.mobile-footer-link > #footer-button.mobile-footer-button.active {
    background-color: var(--fg);
    color: var(--bg);
    border-color: var(--fg);
}

@media (max-width: 420px) {
    body.mobile-template #footer-buttons {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox {
    width: 14px;
    height: 14px;
    cursor: pointer;
    flex-shrink: 0;
    background-color: var(--bg);
    border: 1px solid var(--border);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    accent-color: var(--fg);
    border-radius: 2px;
}

.checkbox:checked {
    background-color: var(--fg);
}

.checkbox-label span {
    font-family: 'MainRegular', monospace;
    font-size: 15px;
    color: var(--fg);
}

.checkbox-label:hover span {
    color: rgb(200, 200, 200);
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.radio {
    width: 14px;
    height: 14px;
    cursor: pointer;
    flex-shrink: 0;
    background-color: var(--bg);
    border: 2px solid var(--border);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border-radius: 50%;
}

.radio:checked {
    background: radial-gradient(circle, var(--fg) 30%, var(--bg) 30%);
}

.radio-label span {
    font-family: 'MainRegular', monospace;
    font-size: 15px;
    color: var(--fg);
}

.radio-label:hover span {
    color: rgb(200, 200, 200);
}

#color-scheme-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 360px;
    padding: 12px;
    background-color: rgba(255, 255, 255, 0);
}

.color-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-family: 'MainRegular', monospace;
    font-size: 14px;
    color: var(--fg);
}

.color-row span {
    min-width: 90px;
    color: var(--subtle);
    letter-spacing: 0.4px;
}

.color-input {
    width: 72px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: 4px;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

.color-input::-webkit-color-swatch,
.color-input::-webkit-color-swatch-wrapper {
    border: none;
    padding: 0;
    border-radius: 3px;
}

.color-input::-moz-color-swatch {
    border: none;
    border-radius: 3px;
}

.color-input:hover {
    border-color: var(--links);
    box-shadow: 0 0 0 1px rgba(48, 90, 173, 0.45);
}

.color-input:active {
    transform: translateY(1px);
}

.dropdown {
    font-family: 'MainRegular', monospace;
    font-size: 14px;
    color: var(--fg);
    background-color: var(--bg);
    border: 1px solid var(--border);
    padding: 8px;
    cursor: pointer;
    box-sizing: border-box;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="white" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 20px;
    padding-right: 36px;
}

.dropdown:hover {
    background-color: rgb(20, 20, 20);
}

.dropdown:focus {
    outline: none;
    background-color: rgb(10, 10, 10);
}

.dropdown option {
    background-color: var(--bg);
    color: var(--fg);
    font-family: 'MainRegular', monospace;
    font-size: 14px;
}

#grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
    margin: 0;
    align-items: stretch;
}

#grid a {
    text-decoration: none;
}

.grid-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid var(--border);
    padding: 8px;
    box-sizing: border-box;
    cursor: pointer !important;
    height: 100%;
    min-height: 220px;
    /* You can adjust min-height as needed */
}

.grid-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background-color: #1a1a1a00;
}

.grid-caption {
    font-family: 'MainBold', monospace;
    font-size: 14px;
    color: var(--fg);
    margin: 0;
    word-wrap: break-word;
    text-decoration: none !important;
}

.grid-subcaption {
    font-family: 'MainRegular', monospace;
    font-size: 12px;
    color: #aaa;
    margin: 0;
    word-wrap: break-word;
    text-decoration: none !important;
}

.grid-delete-form {
    margin-top: auto;
}

.grid-delete-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border: 1px solid #8a3a3a;
    background-color: #231111;
    color: #f5dede;
    font-family: 'MainBold', monospace;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.grid-delete-button:hover {
    background-color: #2d1414;
    border-color: #b24949;
}

.grid-delete-button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.grid-item:hover {
    background-color: #2b2b2b;
    cursor: pointer;
}

h1 {
    font-family: "MainBold", monospace;
    font-size: 20px;
    margin-top: 0;
    margin-bottom: 8px;
}

h2 {
    font-family: "MainRegular", monospace;
    font-size: 14px;
    margin-top: 0;
    margin-bottom: 16px;
    color: var(--subtle)
}

h3 {
    font-family: "MainBold", monospace;
    font-size: 16px;
    margin-top: 24px;
    margin-bottom: 8px;
}

h4 {
    font-family: "MainBold", monospace;
    font-size: 15px;
    margin-top: 20px;
    margin-bottom: 6px;
}

h5 {
    font-family: "MainItalic", monospace;
    font-size: 13px;
    margin-top: 6px;
    margin-bottom: 4px;
    color: var(--subtle);
}

a {
    color: var(--links);
    text-decoration-color: var(--links);
}
a:hover {
    color: var(--links);
    text-decoration-color: var(--links);
}

/* Remove underline on hyperlinked grid captions/subcaptions only */
.grid-caption a,
.grid-subcaption a,
a.grid-caption,
a.grid-subcaption {
    text-decoration: none !important;
}

hr {
    border: 1px solid var(--border)
}

#posts {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

#bookmarks-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

#post {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 2px;
    transition: background-color 0.2s;
    position: relative;
}

#post:hover {
    background-color: rgba(172, 172, 172, 0.1);
    cursor: pointer;
}

#post > :first-child {
    display: flex;
    gap: 8px;
    align-items: center;
}

#post-date {
    font-family: "MainItalic", monospace;
    font-size: 12px;
    color: var(--subtle);
}

#post-bookmark {
    position: absolute;
    top: 12px;
    right: 12px;
    color: var(--subtle);
    font-size: 12px;
    cursor: pointer !important;
}

#post-title {
    font-family: "MainBold", monospace;
    font-size: 16px;
    color: var(--fg);
}

#post-description {
    font-family: "MainRegular", monospace;
    font-size: 13px;
    color: var(--subtle);
}

#post-username {
    font-family: "MainBold", monospace;
    font-size: 14px;
}

#post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

#post-date-feed {
    font-family: "MainItalic", monospace;
    font-size: 12px;
    color: var(--subtle);
}

#post-edit-feed {
    color: var(--subtle);
    cursor: pointer;
}

#post-edit-feed:hover {
    color: rgb(200, 200, 200);
}

.guestbook-post-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.guestbook-delete-form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.guestbook-delete-btn {
    background: none;
    border: none;
    color: var(--subtle);
    cursor: pointer;
    padding: 0;
    font-size: 12px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.guestbook-delete-btn:hover {
    color: rgb(200, 200, 200);
}

.guestbook-edit-btn {
    color: var(--subtle);
    text-decoration: none;
    font-size: 12px;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.guestbook-edit-btn:hover {
    color: rgb(200, 200, 200);
}

.form-button-disabled {
    opacity: 0.55;
    filter: grayscale(100%);
    cursor: not-allowed;
}

.guestbook-pagination {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.guestbook-page-btn {
    color: var(--subtle);
    text-decoration: none;
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: "MainRegular", monospace;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
}

.guestbook-page-btn:hover {
    color: rgb(200, 200, 200);
}

.guestbook-page-btn.current {
    background: var(--border);
    color: var(--fg);
    border-color: var(--border);
}

#post-bookmark-feed {
    color: var(--subtle);
    cursor: pointer !important;
}

#post-bookmark-feed:hover {
    cursor: pointer !important;
    color: rgb(200, 200, 200);
}

#post-content {
    font-family: "MainRegular", monospace;
    font-size: 14px;
    color: var(--fg);
    line-height: 1.4;
}

/* Increase spacing between items in content lists */
#post-content ul,
#bbcode-preview ul {
    margin-top: 8px;
    margin-bottom: 8px;
    padding-left: 20px;
}

#post-content li,
#bbcode-preview li {
    margin-bottom: 4px;
}

#post-image {
    cursor: pointer;
    max-width: 100%;
    height: auto;
}

.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.image-modal.active {
    display: flex;
}

.image-modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.image-modal-filename {
    font-family: "MainRegular", monospace;
    font-size: 12px;
    color: rgb(200, 200, 200);
}

.image-modal img {
    max-width: 85vw;
    max-height: 80vh;
    object-fit: contain;
}

.image-modal-expand {
    font-family: "MainRegular", monospace;
    font-size: 12px;
    color: rgb(48, 90, 173);
    text-decoration: none;
    cursor: pointer;
    border-bottom: 1px solid rgb(48, 90, 173);
}

.image-modal-expand:hover {
    background-color: rgb(48, 90, 173);
    color: var(--bg);
}

.bbcode-editor {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}

.bbcode-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    background-color: var(--bg);
    padding: 8px;
    border: 1px solid var(--border);
    border-bottom: none;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
}

/* Fix label wrapper for image button so it doesn't affect button height */
.bbcode-toolbar label {
    display: contents;
}

.bbcode-btn {
    background-color: transparent;
    color: var(--fg);
    border: 1px solid var(--border);
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    font-family: "MainRegular", monospace;
    transition: background-color 0.2s;
}

.bbcode-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

.bbcode-btn:active {
    background-color: rgba(255, 255, 255, 0.2);
}

.bbcode-btn.disabled,
.bbcode-dropdown.disabled {
    opacity: 0.3;
    pointer-events: none;
    cursor: not-allowed !important;
}

.bbcode-dropdown {
    padding: 8px 12px;
    border: 1px solid var(--border);
    background-color: var(--bg);
    color: var(--fg);
    font-family: "MainRegular", monospace;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.bbcode-dropdown:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.bbcode-dropdown option {
    background-color: var(--bg);
    color: var(--fg);
}

.bbcode-dropdown option[value="h3"] {
    font-size: 18px;
    font-weight: bold;
}

.bbcode-dropdown option[value="h4"] {
    font-size: 16px;
    font-weight: bold;
}

#bbcode-textbox {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    border: 1px solid var(--border);
    background-color: var(--bg);
    color: var(--fg);
    font-family: "MainRegular", monospace;
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
    border-bottom-left-radius: 3px;
    border-bottom-right-radius: 3px;
}

#bbcode-textbox:focus {
    outline: none;
}

#bbcode-preview {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    border: 1px solid var(--border);
    background-color: var(--bg);
    color: var(--fg);
    font-family: "MainRegular", monospace;
    font-size: 14px;
    box-sizing: border-box;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
}#post-image {
    margin-top: 12px;
    max-width: 100%;
    border-radius: 3px;
}

#textbox,
.text-input {
    width: 100%;
    height: 32px;
    font-family: "MainRegular", monospace;
    font-size: 14px;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid var(--border);
    background-color: var(--bg);
    color: var(--fg);
    resize: vertical;
    border-radius: 3px;
}

#textbox.large,
.text-input.large {
    display: block;
    height: 200px;
    resize: vertical;
    box-sizing: border-box;    
}

#textbox:focus,
.text-input:focus {
    outline: none;
    border-color: rgb(77, 118, 201);
}

.form-card {
    border: 1px solid var(--border);
    background-color: rgba(255, 255, 255, 0.02);
    padding: 18px;
    border-radius: 4px;
    margin: 18px 0 28px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

.form-card h2 {
    margin: 0 0 6px 0;
    font-family: "MainBold", monospace;
    font-size: 18px;
}

.form-card p {
    margin: 0 0 14px 0;
    color: var(--subtle);
    line-height: 1.5;
}

.form-field {
    margin: 14px 0;
}

.form-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--subtle);
    letter-spacing: 0.3px;
}

/* Account creation form inputs (match textbox styling) */
#create-account-form input[type="text"] {
    width: 100%;
    height: 32px;
    font-family: "MainRegular", monospace;
    font-size: 14px;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid var(--border);
    background-color: var(--bg);
    color: var(--fg);
    border-radius: 3px;
}

#create-account-form input[type="text"]:focus {
    outline: none;
    border-color: rgb(77, 118, 201);
}

#bbcode-preview h3 {
    margin-top: 24px;
    margin-bottom: 8px;
}

#bbcode-preview h4 {
    margin-top: 20px;
    margin-bottom: 6px;
}

pre code.hljs {
    background-color: var(--bg);
    color: var(--fg);
    border: 1px solid var(--border);
    padding: 12px;
    font-family: "MainRegular", monospace;
    font-size: 14px;
    border-radius: 3px;
}

/* Ensure equal spacing around code blocks */
pre {
    margin: 12px 0;
}
pre code.hljs {
    display: block;
}

#form-button,
#lastfm-link-button,
#color-reset {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid var(--border);
    background-color: var(--bg);
    color: var(--fg);
    font-family: "MainRegular", monospace;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
    box-sizing: border-box;
    width: 100%;
    display: block;
    margin-bottom: 16px;
}

#color-reset {
    margin-top: 10px;
}

#settings-save {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid var(--border);
    background-color: var(--bg);
    color: var(--fg);
    font-family: "MainRegular", monospace;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
    box-sizing: border-box;
    width: 100%;
    display: block;
    margin-bottom: 16px;
}

#two-buttons {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid var(--border);
    background-color: var(--bg);
    color: var(--fg);
    font-family: "MainRegular", monospace;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
    box-sizing: border-box;
    width: 100%;
    display: block;
    margin-bottom: 16px;
}

#form-button:hover,
#lastfm-link-button:hover,
#color-reset:hover {
    background-color: rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

#form-button:active,
#lastfm-link-button:active,
#color-reset:active {
    background-color: var(--bg)
}

#two-buttons:not(:only-of-type) {
    display: inline-block;
    width: calc(50% - 4px);
}

#content > #two-buttons {
    text-align: center;
}

#two-buttons + #two-buttons {
    margin-left: 8px;
}

#two-buttons:hover {
    background-color: rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

#two-buttons:active {
    background-color: var(--bg)
}

#error {
    font-family: "MainBoldItalic", monospace;
    font-size: 14px;
    color: rgb(228, 51, 51);
    margin-bottom: 16px;
}

#search {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

#search-box {
    flex: 1;
    height: 32px;
    font-family: "MainRegular", monospace;
    font-size: 14px;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid var(--border);
    background-color: var(--bg);
    color: var(--fg);
    border-radius: 3px;
}

#search-box:focus {
    outline: none;
    border-color: rgb(77, 118, 201);
}

#search-box::placeholder {
    color: rgb(128, 128, 128);
}

#search-button {
    padding: 6px 16px;
    border: 1px solid var(--border);
    background-color: var(--bg);
    color: var(--fg);
    font-family: "MainRegular", monospace;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
    box-sizing: border-box;
    border-radius: 3px;
}

#search-button:hover {
    background-color: rgb(40, 40, 40);
}

#search-button:active {
    background-color: var(--bg);
}
