:root {
    --bg: #0f172a;
    --card: #111827;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --accent: #60a5fa;
    --border: #1f2937;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
}

.container {
    max-width: 980px;
    margin: 24px auto;
    padding: 0 16px;
}

.stage {
    position: relative;
    width: 350px;
    height: 350px;
    margin: 0 auto 16px;
    background: #0b1220;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,.35);
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--border);
}

#face, #farewellVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hidden {
    display: none;
}

.thinking {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(17,24,39,.8);
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 14px;
}

.controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 16px;
}

.primary, .ghost {
    font: inherit;
    cursor: pointer;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.primary {
    background: var(--accent);
    color: #0b1220;
    border-color: transparent;
}

    .primary:active {
        transform: translateY(1px);
    }

.ghost {
    background: transparent;
    color: var(--text);
}

.io {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px;
}

h3 {
    margin: 8px 0 12px;
    font-weight: 600;
    letter-spacing: .2px;
}

.box {
    background: #0b1220;
    border: 1px solid var(--border);
    border-radius: 12px;
    min-height: 120px;
    padding: 10px;
    color: var(--muted);
    white-space: pre-wrap;
}

@media (max-width: 800px) {
    .io {
        grid-template-columns: 1fr;
    }

    .stage {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
    }
}
