:root {
    /* palette: black, white, neon red (desire), terminal green */
    --red: #ff003c;
    /* one shared corner radius for windows, panels, buttons */
    --radius: 12px;
    /* "floating" glow for a dark room: neutral halo + a touch of desire-red */
    --window-glow:
        0 0 0 1px rgba(255, 255, 255, 0.04),
        0 0 30px rgba(255, 255, 255, 0.05),
        0 0 64px rgba(255, 0, 60, 0.14),
        0 22px 60px rgba(0, 0, 0, 0.7);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: black;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    color: white;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

.page-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 0;
}

.ascii-art pre {
    font-size: 24px;
    line-height: 1.2;
    color: #f6000036
}

.ascii-art {
    color: #444;
}

.click {
    font-style: italic;
    display: inline-block;
    color: var(--red);
    text-decoration: none;
    transition: color 0.2s;
    font-family: "Lekton", monospace;
}

.click:hover {
    color: white;
}

#mobile {
    display: none;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

.json-panel-body::-webkit-scrollbar { width: 6px; }
.json-panel-body::-webkit-scrollbar-track { background: transparent; }
.json-panel-body::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
.json-panel-body::-webkit-scrollbar-thumb:hover { background: #555; }

.window-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    display: none;
    z-index: 999;
}
.window-overlay.active { display: block; }

.window-title-bar {
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.window-title {
    color: #fff;
    font-family: "Lekton", monospace;
    font-style: italic;
    font-size: 16px;
}
.title-bar-controls button {
    color: #fff; background: none; border: none; cursor: pointer; font-size: 28px;
    line-height: 1; padding: 2px 8px; border-radius: var(--radius);
    transition: background 0.2s, color 0.2s;
}
.title-bar-controls button:hover { color: var(--red); background: rgba(255, 255, 255, 0.06); }

.json-window {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 550px; 
    max-width: 50%;
    height: 670px;
    max-height: 70vh;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--window-glow);
    display: none;
    flex-direction: column;
    z-index: 1000;
    background-color: black;
}
.json-window.active { display: flex; }
.json-window .json-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    font-family: "Lekton", monospace;
    font-style: italic;
    font-size: 16px;
    line-height: 1.6;
}
.json-panel-body pre { background: none; margin: 0; white-space: pre-wrap; word-break: break-word; font-family: inherit; }
.json-key   { color: #fff; }
.json-str   { color: var(--red); }
.json-num   { color: #888; }
.json-lit   { color: #888; }
.json-brk   { color: #444; }
.json-punc  { color: #555; }
.type-caret {
    display: inline-block;
    width: 0.5em;
    height: 1.05em;
    background: var(--red);
    vertical-align: text-bottom;
    margin-left: 2px;
    animation: caretBlink 1.1s steps(1, end) infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }

.chat-window-standalone {
    position: fixed;
    bottom: 20px; right: 20px;
    width: 320px;
    height: 210px; 
    max-height: 65vh;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--window-glow);
    display: none;
    flex-direction: column;
    z-index: 1000;
    font-family: "Lekton", monospace;
}
.chat-window-standalone.active { display: flex; }
.chat-window-standalone .chat-window-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.chat-window-standalone .chat-window-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 16px 8px;
}
.chat-window-standalone .typing-indicator-container {
    min-height: 20px;
    padding: 0 16px 16px;
    padding-top: 2px;
    font-family: "Lekton", monospace;
    font-style: italic;
    font-size: 16px;
}

.chat-line {
    font-family: "Lekton", monospace;
    font-style: italic;
    font-size: 16px;
    line-height: 1.65;
    color: #ccc;
    animation: msgIn 0.15s ease-out;
}
@keyframes msgIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.chat-line .username { color: var(--red); }
.chat-line .username.user { color: #888; }

@media (max-width: 768px) {
    #desktop { display: none; }
    #mobile { display: block; }
    .ascii-art pre { font-size: 16px; }
    .json-window {
        left: 50%; width: 90%; max-width: 90%;
        height: 68vh; top: 5%;
        transform: translateX(-50%);
    }
    .chat-window-standalone {
        left: 50%; transform: translateX(-50%);
        width: 90%; max-width: 90%;
        height: 20vh; bottom: 5%; top: auto;
    }
}
