/* Alice's widget and chat for the theme pages (home, news), which do not load app.css. Copied from
   css/app.css ("AI helper" block) on 2026-11-03; the legacy pages take it from app.css itself. */
/* AI helper (/assistant, owner 2026-10-02). */
.assistant {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    gap: 14px;
}

.assistant__hero {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid rgba(240, 198, 116, .3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}

.assistant__banner {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1200 / 520;
    object-fit: cover;
    object-position: center 30%;
}

.assistant__heading {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 60px 22px 16px;
    background: linear-gradient(to bottom, rgba(8, 8, 8, 0), rgba(8, 8, 8, .88) 55%);
}

.assistant__heading h1 {
    margin: 0 0 4px;
    color: #f0c674;
    font-size: 30px;
    letter-spacing: .06em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .8);
}

.assistant__heading p {
    margin: 0;
    max-width: 640px;
    color: #c9bfa8;
    font-size: 13px;
    line-height: 1.45;
}

.assistant__chat {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(240, 198, 116, .18);
    border-radius: 12px;
    background: rgba(9, 8, 9, .7);
}

.assistant__log {
    display: grid;
    align-content: start;
    gap: 12px;
    min-height: 90px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 4px 2px;
}

.assistant__row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.assistant__row--user {
    justify-content: flex-end;
}

.assistant__avatar {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(240, 198, 116, .6);
    box-shadow: 0 0 10px rgba(110, 160, 255, .35);
    object-fit: cover;
}

.assistant__name {
    display: block;
    margin-bottom: 2px;
    color: #f0c674;
    font-size: 12px;
    font-weight: 700;
}

.assistant__examples {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-left: 50px;
}

.assistant__example {
    padding: 6px 12px;
    border: 1px solid rgba(240, 198, 116, .35);
    border-radius: 999px;
    background: rgba(240, 198, 116, .06);
    color: #e8d9b5;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.assistant__example:hover {
    border-color: #f0c674;
    background: rgba(240, 198, 116, .16);
}

/* Alice's lottery: one press opens one ticket (LotteryService). */
.assistant__lottery {
    align-self: flex-start;
    margin-left: 50px;
    padding: 8px 16px;
    border: 1px solid #f0c674;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(240, 198, 116, .28), rgba(240, 198, 116, .1));
    color: #ffe9b0;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .15s;
}

.assistant__lottery:hover {
    background: rgba(240, 198, 116, .36);
    transform: translateY(-1px);
}

.assistant__lottery:disabled {
    opacity: .55;
    cursor: wait;
    transform: none;
}

.assistant__lottery[hidden] {
    display: none;
}

.alice-widget .assistant__lottery {
    margin-left: 0;
    font-size: 13px;
}

/* The prize table is wider than the panel: it scrolls inside its own box and
   must not widen the page (grid items grow to their content unless told not to). */
.admin-lottery-wrap,
.admin-lottery {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    min-width: 0;
    max-width: 100%;
}

.admin-lottery-wrap .highlight-card {
    min-width: 0;
    max-width: 100%;
}

.admin-lottery-wrap .admin-section-head {
    flex-wrap: wrap;
}

.admin-lottery-wrap .admin-section-head > span {
    border-radius: 10px;
}

.admin-lottery__table {
    max-width: 100%;
    overflow-x: auto;
}

.admin-lottery__table .admin-table th,
.admin-lottery__table .admin-table td {
    padding: 6px 4px;
    white-space: nowrap;
}

.admin-lottery__table input[type="text"] {
    width: 170px;
}

.admin-lottery__table input[type="number"] {
    width: 54px;
    padding-left: 6px;
    padding-right: 2px;
}

.admin-lottery__table input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.admin-lottery__table input[data-f="zen"],
.admin-lottery__table input[data-f="zen_max"] {
    width: 92px;
}

.admin-lottery__table input:disabled {
    opacity: .3;
}

.donate-pack__tickets {
    display: block;
    margin-top: 4px;
    color: #f0c674;
    font-size: 13px;
    font-weight: 600;
}

.assistant__msg {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 10px;
    color: #e8e2d4;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.assistant__msg--bot {
    justify-self: start;
    background: rgba(240, 198, 116, .08);
    border: 1px solid rgba(240, 198, 116, .2);
    border-bottom-left-radius: 3px;
}

.assistant__msg--user {
    justify-self: end;
    background: rgba(70, 120, 200, .18);
    border: 1px solid rgba(110, 160, 240, .3);
}

.assistant__msg--pending {
    opacity: .6;
}

.assistant__msg--error {
    border-color: rgba(220, 80, 80, .45);
}

.assistant__sources {
    margin-top: 8px;
    font-size: 12px;
    color: #a99c80;
    white-space: normal;
}

.assistant__sources a {
    color: #f0c674;
}

.assistant__votes {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    white-space: normal;
}

.assistant__vote {
    padding: 2px 8px;
    border: 1px solid rgba(240, 198, 116, .25);
    border-radius: 999px;
    background: transparent;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    opacity: .7;
    transition: opacity .15s, border-color .15s;
}

.assistant__vote:hover {
    opacity: 1;
    border-color: #f0c674;
}

.assistant__voted {
    color: #a99c80;
    font-size: 12px;
}

.assistant__reset {
    justify-self: end;
    padding: 0;
    border: 0;
    background: none;
    color: #a99c80;
    font: inherit;
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
}

.assistant__reset:hover {
    color: #f0c674;
}

.assistant__examples[hidden],
.assistant__reset[hidden] {
    display: none;
}

/* Alice in the corner of every page (owner, 2026-10-03). */
.alice-widget {
    position: fixed;
    z-index: 70;
    right: 16px;
    bottom: 16px;
}

.alice-widget__toggle {
    display: block;
    width: 60px;
    height: 60px;
    padding: 0;
    border: 2px solid #f0c674;
    border-radius: 50%;
    overflow: hidden;
    background: #0c0b0b;
    box-shadow: 0 0 0 4px rgba(240, 198, 116, .15), 0 6px 18px rgba(0, 0, 0, .6), 0 0 18px rgba(110, 160, 255, .35);
    cursor: pointer;
    transition: transform .15s;
}

.alice-widget__toggle:hover {
    transform: scale(1.06);
}

.alice-widget__toggle img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.alice-widget--open .alice-widget__toggle {
    display: none;
}

/* Her line beside the button: "I'm Alice. How can I help?" (owner, 2026-10-08). */
.alice-widget__bubble {
    position: absolute;
    right: 74px;
    bottom: 12px;
    display: flex;
    align-items: center;
    gap: 2px;
    max-width: calc(100vw - 110px);
    padding: 2px 4px 2px 0;
    border: 1px solid rgba(240, 198, 116, .55);
    border-radius: 14px 14px 4px 14px;
    background: linear-gradient(180deg, #1a1819, #0f0e0f);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .6), 0 0 14px rgba(110, 160, 255, .2);
    animation: alice-bubble-in .35s ease-out both;
}

.alice-widget__bubble[hidden],
.alice-widget--open .alice-widget__bubble {
    display: none;
}

/* The tail towards her portrait. */
.alice-widget__bubble::after {
    content: "";
    position: absolute;
    right: -7px;
    bottom: 8px;
    width: 12px;
    height: 12px;
    border-top: 1px solid rgba(240, 198, 116, .55);
    border-right: 1px solid rgba(240, 198, 116, .55);
    background: #151314;
    transform: rotate(45deg);
}

.alice-widget__bubble-text {
    padding: 8px 4px 8px 14px;
    border: 0;
    background: none;
    color: #f3e9d2;
    font: inherit;
    font-size: 13px;
    line-height: 1.3;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}

.alice-widget__bubble-text:hover {
    color: #f0c674;
}

.alice-widget__bubble-close {
    position: relative;
    z-index: 1;
    padding: 2px 6px;
    border: 0;
    background: none;
    color: #8f8672;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.alice-widget__bubble-close:hover {
    color: #f0c674;
}

@keyframes alice-bubble-in {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 600px) {
    .alice-widget__bubble {
        right: 64px;
        bottom: 8px;
    }

    .alice-widget__bubble-text {
        white-space: normal;
    }
}

@media (prefers-reduced-motion: reduce) {
    .alice-widget__bubble {
        animation: none;
    }
}

.alice-widget__panel {
    display: grid;
    grid-template-rows: auto 1fr;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 32px);
    border: 1px solid rgba(240, 198, 116, .35);
    border-radius: 14px;
    overflow: hidden;
    background: #0c0b0b;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .7);
}

.alice-widget__panel[hidden] {
    display: none;
}

.alice-widget__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(240, 198, 116, .2);
    background: linear-gradient(90deg, rgba(240, 198, 116, .12), rgba(110, 160, 255, .08));
}

.alice-widget__head img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(240, 198, 116, .6);
}

.alice-widget__head strong {
    flex: 1;
    color: #f0c674;
    font-size: 14px;
}

.alice-widget__open,
.alice-widget__close {
    padding: 0 6px;
    border: 0;
    background: none;
    color: #c9bfa8;
    font-size: 20px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.alice-widget__open {
    font-size: 16px;
}

.alice-widget__open:hover,
.alice-widget__close:hover {
    color: #f0c674;
}

.alice-widget .assistant__chat {
    grid-template-rows: 1fr auto auto auto;
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: none;
}

.alice-widget .assistant__log {
    max-height: none;
    min-height: 0;
}

.alice-widget .assistant__examples {
    padding-left: 0;
}

.alice-widget .assistant__msg {
    max-width: 85%;
    font-size: 13px;
}

.alice-widget .assistant__form {
    flex-direction: row;
}

@media (max-width: 600px) {
    .alice-widget {
        right: 10px;
        bottom: 10px;
    }

    .alice-widget__toggle {
        width: 52px;
        height: 52px;
    }

    .alice-widget--open {
        inset: 0;
    }

    .alice-widget__panel {
        width: 100vw;
        max-width: none;
        height: 100%;
        max-height: none;
        border-radius: 0;
    }
}

.assistant__form {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.assistant__input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid rgba(240, 198, 116, .3);
    border-radius: 8px;
    background: rgba(0, 0, 0, .5);
    color: #fff;
    font: inherit;
    resize: vertical;
}

@media (max-width: 600px) {
    .assistant__form {
        flex-direction: column;
    }

    .assistant__msg {
        max-width: 100%;
    }

    .assistant__heading {
        position: static;
        padding: 10px 14px 12px;
        background: rgba(8, 8, 8, .88);
    }

    .assistant__heading h1 {
        font-size: 22px;
    }

    .assistant__heading p {
        font-size: 12px;
    }

    .assistant__examples {
        padding-left: 0;
    }
}

/* The theme's base.css sets buttons in capitals; Alice speaks in sentences. */
.alice-widget button,
.alice-widget input,
.alice-widget textarea {
    text-transform: none;
    letter-spacing: normal;
}
