:root {
    --background: #1a1510;
    --panel: #2d2416;
    --panel-header: #1a151081;
    --border: #5c4a3d;
    --text: #7a6b5a;
    --heading: #d4c4a8;
    --highlight: #a99b83;
}

html, body { min-height: 100%; margin: 0; }

body {
    display: flex;
    height: 100dvh;
    overflow: hidden;
    background: var(--background);
    color: var(--text);
    font-family: 'IM Fell English', sans-serif, serif;
}

h1, h2, h3 { color: var(--heading); text-shadow: 2px 2px 4px #00000080; }
button { font: inherit; }
iconify-icon { margin-bottom: 2px; }

.highlight { padding: 1px 2px; border-radius: 3px; background: #3a2f1e; color: var(--highlight); }
ul { margin: 10px 0; padding-left: 20px; }
li { margin-bottom: 5px; }

.content {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100dvh;
}

.page-title {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--background);
}

.page-title img { width: 36px; height: auto; }
.page-title h1 { margin: 0; }

.content-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 15px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--background);
}

.content-body > div + div { margin-top: 15px; }

.content-body > div {
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--panel);
}

.content-body h2 {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 10px;
    border-radius: 4px 4px 0 0;
    background: var(--panel-header);
    font-size: 16px;
}

.content-body p { box-sizing: border-box; margin: 0; padding: 10px; }

.demo-video-button,
.invites-toggle,
.invites-close {
    border: 1px solid var(--border);
    border-radius: 3px;
    background: transparent;
    color: var(--heading);
    cursor: pointer;
}

.demo-video-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    font-size: 16px;
}

.demo-video-button:hover { transform: scale(1.05); }

.invites {
    flex: 0 0 420px;
    width: 420px;
    height: 100dvh;
    box-sizing: border-box;
    overflow-y: auto;
    padding: 20px;
    border-left: 1px solid var(--border);
    background: var(--panel);
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--background);
}

.invites-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.invites h1 { display: flex; align-items: center; gap: 5px; margin: 0 0 20px; }
.invites-toggle, .invites-close { display: none; }

.invite-card {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 3px;
    box-shadow: 0 4px 6px #0006;
    color: var(--text);
    text-decoration: none;
}

.invite-card:hover { transform: scale(1.02); }
.invite-card > img { flex: 0 0 auto; width: 42px; height: auto; border: 1px solid var(--border); border-radius: 50%; }
.invite-card > div { display: flex; flex-direction: column; min-width: 0; }
.invite-card h3 { margin: 0; font-size: 16px; }

.bot-hint { margin-left: 5px; padding: 2px; border-radius: 3px; vertical-align: 1px; font-family: sans-serif, serif; font-size: 10px; }
.bot-hint.required { background: #88353588; }
.bot-hint.optional { background: #357a8888; }

.video-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 30;
    display: flex;
    flex-direction: column;
    width: min(70%, 1000px);
    height: min(90vh, 650px);
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--panel);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(.96);
    transition: transform .3s ease-in-out, opacity .3s ease-in-out;
}

.video-modal.active { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }

.video-modal .topbar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-radius: 4px 4px 0 0;
    background: var(--panel-header);
    color: var(--heading);
    text-shadow: 2px 2px 4px #00000080;
}

.video-modal .topbar button {
    border: 0;
    background: transparent;
    color: var(--heading);
    cursor: pointer;
    font-size: 20px;
    transition: transform .1s ease-in-out, color .1s ease-in-out;
}

.video-modal .topbar button:hover { color: #88353588; transform: scale(1.2); }
.video-modal iframe { flex: 1; min-height: 0; width: 100%; border: 0; }

.content-body::-webkit-scrollbar,
.invites::-webkit-scrollbar { width: 10px; }

.content-body::-webkit-scrollbar-track,
.invites::-webkit-scrollbar-track { border-radius: 6px; background: var(--background); }

.content-body::-webkit-scrollbar-thumb,
.invites::-webkit-scrollbar-thumb { border: 2px solid var(--background); border-radius: 6px; background: var(--border); }

.content-body::-webkit-scrollbar-thumb:hover,
.invites::-webkit-scrollbar-thumb:hover { background: var(--text); }

@media (max-width: 900px) {
    .content { width: 100%; }

    .invites-toggle {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        margin-left: auto;
        padding: 6px 8px;
    }

    .invites {
        position: fixed;
        top: 0;
        right: 0;
        z-index: 20;
        width: min(100%, 420px);
        height: 100dvh;
        padding: 20px;
        border-top: 0;
        border-left: 1px solid var(--border);
        box-shadow: -6px 0 16px #0009;
        transform: translateX(100%);
        transition: transform .25s ease-in-out;
    }

    .invites.active { transform: translateX(0); }
    .invites-close { display: inline-flex; padding: 5px; font-size: 1.2rem; }
    .video-modal { width: min(90%, 700px); height: min(75vh, 500px); }
}

@media (max-width: 540px) {
    .page-title { align-items: flex-start; gap: 8px; padding: 10px 12px; }
    .page-title img { width: 32px; margin-top: 3px; }
    .page-title h1, .invites h1 { font-size: 1.5rem; }
    .invites-toggle { font-size: .9rem; }
    .content-body { padding: 12px; }
    .content-body > div + div { margin-top: 12px; }
    .content-body h2 { flex-wrap: wrap; padding: 9px; font-size: 1rem; }
    .demo-video-button { margin-left: 0; }
    .content-body p, .content li, .invite-card > div > span { font-size: .95rem; line-height: 1.35; }
    .invite-card { gap: 8px; padding: 9px; }
    .invite-card > img { width: 38px; }
    .invite-card h3 { font-size: .95rem; }
    .video-modal { width: calc(100% - 24px); height: auto; max-height: calc(100vh - 24px); aspect-ratio: 16 / 10; }
}