@font-face {
    font-family: 'opendyslexicregular';
    src: url('/static/fonts/opendyslexic-regular-webfont.woff2') format('woff2'),
         url('/static/fonts/opendyslexic-regular-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    /* These intentionally mirror the NioBot dashboard. */
    --site-bg: #454545;
    --site-surface: #171717;
    --site-surface-raised: #202020;
    --site-surface-hover: #292929;
    --site-input: #101010;
    --site-border: #4a4a4a;
    --site-border-strong: #666666;
    --site-text: #f5f5f5;
    --site-muted: #bdbdbd;
    --site-soft: #8f8f8f;
    --site-focus: #ffffff;
    --site-radius-large: 18px;
    --site-radius: 16px;
    --site-radius-small: 11px;
    --site-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
    --site-card-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
    --site-width: min(1400px, calc(100% - 32px));
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    color-scheme: dark;
    background: var(--site-bg);
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 0 0 56px;
    overflow-x: hidden;
    background: var(--site-bg);
    color: var(--site-text);
    font-family: opendyslexicregular, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    text-align: center;
}

.vignette {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    box-shadow: 0 0 200px rgba(0, 0, 0, 0.9) inset;
    z-index: -2;
}

h1, h2, h3, h4, h5, h6, p {
    overflow-wrap: anywhere;
}

/* The old site rotated headings and buttons on hover. The dashboard does not. */
h1:hover, h2:hover, h3:hover, h4:hover, h5:hover, h6:hover {
    transform: none;
}

a {
    color: #eeeeee;
    text-decoration-color: #737373;
    text-underline-offset: 3px;
}

a:hover {
    color: #ffffff;
    text-decoration-color: #aaaaaa;
}

button,
.button,
input,
select,
textarea {
    font-family: inherit;
}

button {
    min-width: 0;
    min-height: 42px;
    padding: 9px 14px;
    color: var(--site-text);
    background: #111111;
    border: 1px solid var(--site-border-strong);
    border-radius: 10px;
    box-shadow: none;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

button:hover {
    background: #2b2b2b;
    border-color: #8a8a8a;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--site-focus);
    outline-offset: 2px;
}

/* -------------------------------------------------------------------------
   Shared navigation — a compact dashboard toolbar card.
   ------------------------------------------------------------------------- */
.top-links,
.top-links-container {
    width: var(--site-width);
    margin: 20px auto;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(20, 20, 20, 0.92);
    border: 1px solid var(--site-border);
    border-radius: var(--site-radius-large);
    box-shadow: var(--site-shadow);
}

.top-links br,
.top-links-container br {
    display: none;
}

.top-links button,
.top-links-container button {
    min-height: 42px;
    padding: 9px 15px;
    background: #111111;
    border-color: var(--site-border-strong);
    white-space: nowrap;
}

.top-links a,
.top-links-container a {
    color: var(--site-text);
    text-decoration: none;
}

.top-links button > a,
.top-links-container a > button {
    display: block;
}

/* -------------------------------------------------------------------------
   Page intro cards — directly based on the Bot Settings header card.
   ------------------------------------------------------------------------- */
.top-text,
.page-heading-card {
    width: var(--site-width);
    margin: 0 auto 20px;
    padding: clamp(22px, 3vw, 34px);
    background: rgba(20, 20, 20, 0.92);
    border: 1px solid var(--site-border);
    border-radius: var(--site-radius-large);
    box-shadow: var(--site-shadow);
    text-align: left;
}

.top-text h1,
.page-heading-card h1 {
    margin: 0 0 6px;
    color: var(--site-text);
    font-size: clamp(1.8rem, 3vw, 2.55rem);
    line-height: 1.2;
}

.top-text h2,
.top-text h3,
.top-text h4,
.top-text h5,
.top-text h6,
.page-subtitle {
    max-width: 920px;
    margin: 5px 0 0;
    color: var(--site-muted);
    font-size: clamp(0.82rem, 1.3vw, 1rem);
    font-weight: 400;
    line-height: 1.55;
}

.home-page .top-text {
    padding: clamp(26px, 4vw, 44px);
}

.home-page .top-text #Name {
    margin-bottom: 8px;
    font-size: clamp(2.3rem, 5vw, 3.8rem);
}

/* -------------------------------------------------------------------------
   Homepage social links — same two-column compact cards as Bot Settings.
   Gradient declarations remain in links_fancyness.css.
   ------------------------------------------------------------------------- */
.links {
    width: var(--site-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.links > a {
    min-width: 0;
    text-decoration: none;
}

.links > a > button {
    position: relative;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 78px;
    padding: 16px 54px 16px 18px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    color: var(--site-text);
    background: var(--site-surface);
    border: 1px solid var(--site-border);
    border-radius: var(--site-radius);
    box-shadow: var(--site-card-shadow);
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.3;
    text-align: left;
    white-space: normal;
}

.links > a > button:hover {
    background: var(--site-surface-raised);
    border-color: var(--site-border-strong);
}

.links > a > button::after {
    content: "↗";
    position: absolute;
    right: 18px;
    top: 50%;
    width: 30px;
    height: 30px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    color: var(--site-muted) !important;
    -webkit-text-fill-color: var(--site-muted) !important;
    border: 1px solid var(--site-border);
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1;
}

/* -------------------------------------------------------------------------
   Setup page — top-level dashboard cards with nested setting-style rows.
   ------------------------------------------------------------------------- */
.items {
    width: var(--site-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.items > br,
.thingy > br {
    display: none;
}

.thingy {
    min-width: 0;
    padding: 0 0 18px;
    overflow: hidden;
    background: var(--site-surface);
    border: 1px solid var(--site-border);
    border-radius: var(--site-radius);
    box-shadow: var(--site-card-shadow);
    text-align: left;
}

.thingy:hover {
    border-color: var(--site-border-strong);
}

.thingy-title {
    margin: 0 0 4px;
    padding: 16px 18px;
    color: var(--site-text);
    background: transparent;
    border-bottom: 1px solid #353535;
    font-size: clamp(1.15rem, 2vw, 1.55rem);
    line-height: 1.3;
}

.thingy h3 {
    margin: 14px 18px 6px;
    color: var(--site-muted);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.025em;
}

.thingy h5 {
    min-height: 52px;
    margin: 0 18px 10px;
    padding: 11px 14px;
    display: flex;
    align-items: center;
    color: var(--site-text);
    background: var(--site-surface-raised);
    border: 1px solid #414141;
    border-radius: var(--site-radius-small);
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.thingy h5:hover {
    background: var(--site-surface-hover);
    border-color: #626262;
}

.thingy h5 a {
    width: 100%;
    color: var(--site-text);
}

/* -------------------------------------------------------------------------
   TTS — the section shells and playable rows mirror Chat Alerts cards.
   ------------------------------------------------------------------------- */
.lists {
    width: var(--site-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.sound-effects,
.voices {
    min-width: 0;
    width: 100%;
    padding: 18px;
    background: var(--site-surface);
    border: 1px solid var(--site-border);
    border-radius: var(--site-radius);
    box-shadow: var(--site-card-shadow);
    text-align: left;
}

.sound-effects > br,
.voices > br {
    display: none;
}

.sound-effects > p,
.voices > p {
    margin: 0 0 12px;
    padding: 0 2px 11px;
    color: var(--site-text);
    border-bottom: 1px solid #353535;
    font-size: 0.96rem;
    font-weight: 700;
}

.sound-effects > p:not(:first-child),
.voices > p:not(:first-child) {
    margin-top: 18px;
}

.sound-effects h6,
.voices h6 {
    position: relative;
    width: 100%;
    min-height: 52px;
    margin: 10px 0 0;
    padding: 11px 46px 11px 14px;
    display: flex;
    align-items: center;
    color: var(--site-text);
    background: var(--site-surface-raised);
    border: 1px solid #414141;
    border-radius: var(--site-radius-small);
    box-shadow: none;
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.sound-effects h6::after,
.voices h6::after {
    content: "▶";
    position: absolute;
    right: 12px;
    top: 50%;
    width: 25px;
    height: 25px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    color: var(--site-muted);
    border: 1px solid #4b4b4b;
    border-radius: 50%;
    font-size: 0.58rem;
    line-height: 1;
}

.sound-effects h6:hover,
.voices h6:hover {
    background: var(--site-surface-hover);
    border-color: #626262;
}

/* -------------------------------------------------------------------------
   Generic cards, forms and error pages.
   ------------------------------------------------------------------------- */
.footer {
    width: var(--site-width);
    margin: 20px auto 0;
    padding: 18px 22px;
    color: var(--site-muted);
    background: var(--site-surface);
    border: 1px solid var(--site-border);
    border-radius: var(--site-radius);
    box-shadow: var(--site-card-shadow);
}

.footer h3,
.footer p {
    margin: 5px 0;
}

.error-card {
    width: min(960px, calc(100% - 32px));
    min-height: 280px;
    margin: 64px auto 20px;
    padding: clamp(30px, 5vw, 58px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(20, 20, 20, 0.94);
    border: 1px solid var(--site-border);
    border-radius: var(--site-radius-large);
    box-shadow: var(--site-shadow);
}

.error-card .hi {
    margin: 0;
}

.error-card h1 {
    color: var(--site-text);
    font-size: clamp(1.7rem, 4vw, 2.6rem);
}

.error-card h2,
.error-card h3 {
    color: var(--site-muted);
}

input,
select,
textarea {
    min-height: 44px;
    padding: 10px 12px;
    color: var(--site-text);
    background: var(--site-input);
    border: 1px solid var(--site-border);
    border-radius: 10px;
    box-shadow: none;
    outline: none;
}

/* -------------------------------------------------------------------------
   Responsive behavior matches the dashboard: two columns -> one column.
   ------------------------------------------------------------------------- */
@media (max-width: 820px) {
    .links,
    .items,
    .lists {
        grid-template-columns: 1fr;
    }

    .top-links,
    .top-links-container {
        justify-content: stretch;
    }

    .top-links button,
    .top-links-container > a,
    .top-links-container > a > button {
        flex: 1 1 150px;
    }
}

@media (max-width: 520px) {
    body {
        padding-bottom: 30px;
        font-size: 14px;
    }

    :root {
        --site-width: min(100% - 20px, 1400px);
    }

    .top-links,
    .top-links-container {
        border-radius: 14px;
    }

    .top-links button,
    .top-links-container > a,
    .top-links-container > a > button {
        width: 100%;
        flex-basis: 100%;
    }

    .top-text,
    .page-heading-card {
        padding: 18px;
        border-radius: 14px;
    }

    .links > a > button {
        min-height: 68px;
    }

    .thingy,
    .sound-effects,
    .voices {
        border-radius: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
