:root {
    --bg-pattern: repeating-linear-gradient(45deg, #f7f2e7 0 8px, #f3ead8 8px 16px), linear-gradient(#fff, #f4f0e6);
    --color-bg-title: linear-gradient(#213ca0, #1d3694);
    --color-text-title: #fff;
    --color-link: #551a8b;
    --color-bg-link-hover: #fffdc7;
    --color-marquee-bg: #111;
    --color-marquee-text: #9cff57;
    --color-container-bg: #fbfbfb;
    --color-card-header-gradient: linear-gradient(#efefef, #dcdcdc);;
    --color-card-body-bg: #fff;
    --color-text-2: #111;
    --color-text-mute: #555;
    --color-border: #666;
    --color-bg-footer: #f1f1f1;
    --bg-featured-title-pattern: linear-gradient(#fff3a0, #ffd24d);
    --bg-featured-body-pattern: linear-gradient(#fffef2, #ffffff);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-pattern: repeating-linear-gradient(45deg, #271f0d 0px, #271f0d 8px, #3e3013 8px, #3e3013 16px), linear-gradient(#181a1b, #262011);
        --color-bg-title: linear-gradient(#3b5bd6, #2443b9);
        --color-text-title: #fff;
        --color-link: #ae73e5;
        --color-bg-link-hover: #3f3d00;
        --color-marquee-bg: #0d0e0e;
        --color-marquee-text: #8ce64f;
        --color-container-bg: #1a1c1e;
        --color-card-header-gradient: linear-gradient(#212425, #2c2f31);
        --color-card-body-bg: #181a1b;
        --color-text-2: #dddad6;
        --color-text-mute: #b2aca2;
        --color-border: #655e53;
        --color-bg-footer: #202324;
        --bg-featured-title-pattern: linear-gradient(#765800, #514700);
        --bg-featured-body-pattern: linear-gradient(#2c2900, #181a1b);
    }
}

*, *::before, *::after {
    box-sizing: border-box;
}

*:not(dialog) {
    margin: 0;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        interpolate-size: allow-keywords;
    }
}

body {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

input, button, textarea, select {
    font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

p {
    text-wrap: pretty;
}
h1, h2, h3, h4, h5, h6 {
    text-wrap: balance;
}

/* === ACTUAL STYLES === */

body {
    color: var(--color-text-2);
    font-family: Tahoma, Verdana, Arial, sans-serif;
    font-size: 1rem;
    background: var(--bg-pattern);
}

a {
    color: var(--color-link);
}
a:hover {
    background-color: var(--color-bg-link-hover);
}
p:not(:last-of-type) {
    margin-bottom: 1rem;
}

header {
}

footer {
    padding: 8px 20px;
    border-top: 1px solid var(--color-border);
    background-color: var(--color-bg-footer);
    font-size: 0.9rem;
    color: var(--color-text-mute);
}

.container {
    max-width: 860px;
    margin: 10px auto 10px auto;
    border: 1px solid var(--color-border);
    background-color: var(--color-container-bg);
}

.website-title {
    padding: 6px 8px;
    background: var(--color-bg-title);
    color: var(--color-text-title);
}

.website-subtitle {
    background-color: var(--color-marquee-bg);
    color: var(--color-marquee-text);
    font-family: monospace;
    padding: 3px 8px;
}

.main {
    padding: 20px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 20px;

    /*height: 580px;*/
    /*max-height: 100%;*/
}

.left-panel {
    flex: 0 0 210px;
}
.right-panel {
    width: 100%;
    /*overflow-y: auto;*/
}

.page-content {
}

.card {
    margin-bottom: 10px;
    border: 1px solid var(--color-border);
}

.card.card-highlight {
}

.card.card-highlight > .card-title {
}

.card-title {
    font-variant-caps: all-petite-caps;
    font-weight: bold;
    padding: 3px 8px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-card-header-gradient);
}
summary.card-title {
    cursor: pointer;
}

.card-body {
    padding: 6px 8px;
}

.now-playing-metadata {
    margin-bottom: 0.5rem;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;

    display: flex;
    gap: 8px;
}

.now-playing-metadata > img {
    flex: 0 0 auto;
    width: 4rem;
    height: 4rem;
    object-fit: cover;
    border: 1px solid var(--color-border);
}

.now-playing-track-title {
    font-size: 1.2rem;
}

.card.featured {
}
.card.featured .card-title {
    background: var(--bg-featured-title-pattern);
}
.card.featured .card-body {
    background: var(--bg-featured-body-pattern);
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

audio {
    width: 100%;
}

/* === LIVE CHAT === */
.chat-card .card-body {
    display: flex;
    flex-direction: column;
    height: 320px;
    padding: 0;
}

.chat-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 6px 8px;
    display: flex;
    flex-direction: column-reverse;
    font-size: 1rem;
}

.chat-message {
    line-height: 1.4;
    word-break: break-word;
}
p.chat-message {
    margin: 0;
}
.chat-time {
    font-family: "Courier New", Courier, monospace;
    color: var(--color-text-mute);
    margin-right: 6px;
}
.chat-username {
    font-weight: bold;
    color: var(--color-link);
    margin-right: 6px;
}
.chat-text {
    color: var(--color-text-2);
}

.chat-empty {
    margin: auto;
    color: var(--color-text-mute);
    font-style: italic;
}

.chat-form {
    display: flex;
    gap: 6px;
    padding: 6px 8px;
    border-top: 1px solid var(--color-border);
    background: var(--color-card-header-gradient);
}
.chat-form input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 3px 6px;
    border: 1px solid var(--color-border);
    background: var(--color-card-body-bg);
    color: var(--color-text-2);
}
.chat-form button {
    padding: 3px 12px;
    border: 1px solid var(--color-border);
    background: var(--color-card-header-gradient);
    color: var(--color-text-2);
    font-weight: bold;
    cursor: pointer;
}
.chat-form button:hover {
    background: var(--color-bg-link-hover);
}

.mono {
    font-family: "Courier New", Courier, monospace;
}

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

.tiny {
    font-size: 0.9rem;
}

/* === RESPONSIVE (mobile) === */
@media (max-width: 640px) {
    .container {
        max-width: none;
        margin: 0;
        border-left: 0;
        border-right: 0;
    }

    .main {
        flex-direction: column;
        padding: 12px;
        gap: 12px;
    }

    .left-panel {
        flex: 1 1 auto;
        width: 100%;
    }
}
