/* ============================================
   13 <33 Covenant - floating chat widget
   Launcher button + pop-up panel wrapping the
   widget.st embed. Injected by chat-widget.js.
   ============================================ */

@font-face {
    font-family: 'basiic';
    src: url('https://cinni.net/fonts/basiic.ttf');
    font-display: swap;
}

:root {
    /* Pages override these to dodge their own fixed corner elements. */
    --chat-bottom: 20px;
    --chat-right: 20px;
}

/* ===== Launcher button ===== */
.chat-launcher {
    position: fixed;
    bottom: var(--chat-bottom);
    right: var(--chat-right);
    z-index: 8600;
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 50%;
    border: 2px solid #9B6CD8;
    background: linear-gradient(180deg, #e0ccf8 0%, #c4a8e8 100%);
    color: #322036;
    font-size: 24px;
    line-height: 1;
    cursor: pointer !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(40, 10, 80, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.chat-launcher:hover {
    transform: translateY(-3px) scale(1.06);
    background: linear-gradient(180deg, #ecdcff 0%, #d4b8f0 100%);
    box-shadow: 0 8px 20px rgba(40, 10, 80, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.chat-launcher:active { transform: translateY(0) scale(0.98); }

.chat-launcher:focus-visible {
    outline: 2px solid #84c4c4;
    outline-offset: 3px;
}

.chat-launcher[hidden] { display: none !important; }

/* Small pulse ring so it reads as interactive on first visit */
.chat-launcher-ring {
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 2px solid #96799c;
    opacity: 0;
    pointer-events: none;
    animation: chatLauncherPulse 2.6s ease-out infinite;
}

@keyframes chatLauncherPulse {
    0%   { transform: scale(1);    opacity: 0.55; }
    70%  { transform: scale(1.45); opacity: 0; }
    100% { transform: scale(1.45); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .chat-launcher-ring { animation: none; }
    .chat-launcher, .chat-panel { transition: none; }
}

/* ===== Panel ===== */
.chat-panel {
    position: fixed;
    bottom: calc(var(--chat-bottom) + 68px);
    right: var(--chat-right);
    z-index: 9500;
    width: 340px;
    height: 460px;
    max-height: calc(100vh - var(--chat-bottom) - 88px);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 2px solid #9B6CD8;
    border-radius: 14px;
    background: #f3ecff;
    box-shadow: 0 18px 44px rgba(40, 10, 80, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.chat-panel.open { display: flex; }

.chat-panel-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 8px 8px 12px;
    background: linear-gradient(180deg, #e0ccf8 0%, #c4a8e8 100%);
    border-bottom: 2px solid #9B6CD8;
    flex: 0 0 auto;
}

.chat-panel-title {
    flex: 1;
    min-width: 0;
    font-family: 'basiic', 'MS UI Gothic', Arial, sans-serif;
    font-size: 15px;
    letter-spacing: 0.5px;
    color: #322036;
    text-transform: uppercase;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-panel-x {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 2px solid #9B6CD8;
    border-radius: 6px;
    background: #f3ecff;
    color: #322036;
    font-size: 13px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer !important;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.15s ease;
}

.chat-panel-x:hover { background: #96799c; color: #fff; transform: scale(1.08); }

.chat-panel-body {
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
    background: #fff;
    overflow: hidden;
}

.chat-panel-body ws-widget {
    display: block;
    width: 100%;
    height: 100%;
}

.chat-panel-body iframe { border: 0; }

.chat-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'MS UI Gothic', Arial, sans-serif;
    font-size: 12px;
    letter-spacing: 1px;
    color: #6a5a82;
    background: #f3ecff;
    pointer-events: none;
}

/* ===== Mobile: bottom sheet ===== */
@media (max-width: 600px) {
    .chat-panel {
        left: 0;
        right: 0;
        bottom: 0;
        width: auto;
        height: 78vh;
        max-height: 78vh;
        border-radius: 14px 14px 0 0;
        border-bottom: none;
    }
}

/* ============================================
   Glass skin - angelOS only.
   angelOS shares no CSS with the rest of the
   site; purple pixel chrome looks wrong there.
   ============================================ */
.chat-launcher.chat-skin-glass {
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 14px;
    background: rgba(132, 196, 196, 0.28);
    -webkit-backdrop-filter: blur(14px) saturate(1.3);
    backdrop-filter: blur(14px) saturate(1.3);
    color: #f2fbfb;
    box-shadow: 0 8px 22px rgba(10, 40, 50, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.chat-launcher.chat-skin-glass:hover {
    background: rgba(132, 196, 196, 0.42);
    box-shadow: 0 12px 28px rgba(10, 40, 50, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.chat-launcher.chat-skin-glass .chat-launcher-ring { border-color: rgba(255, 255, 255, 0.55); }

.chat-panel.chat-skin-glass {
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 14px;
    background: rgba(18, 52, 60, 0.55);
    -webkit-backdrop-filter: blur(18px) saturate(1.25);
    backdrop-filter: blur(18px) saturate(1.25);
    box-shadow: 0 20px 46px rgba(6, 30, 38, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.chat-panel.chat-skin-glass .chat-panel-bar {
    background: rgba(255, 255, 255, 0.12);
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.chat-panel.chat-skin-glass .chat-panel-title {
    font-family: 'Outfit', 'Inter', 'MS UI Gothic', Arial, sans-serif;
    font-weight: 600;
    letter-spacing: 1px;
    color: #f2fbfb;
    text-shadow: none;
}

.chat-panel.chat-skin-glass .chat-panel-x {
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.14);
    color: #f2fbfb;
}

.chat-panel.chat-skin-glass .chat-panel-x:hover { background: rgba(255, 255, 255, 0.3); color: #fff; }

.chat-panel.chat-skin-glass .chat-panel-body { background: rgba(255, 255, 255, 0.9); }

.chat-panel.chat-skin-glass .chat-loading { background: transparent; color: #dff3f3; }
