:root {
    --bg-dark: #0f172a;
    --bg-gradient: radial-gradient(circle at top left, #1e1b4b, #0f172a);
    --glass-bg: rgba(15, 23, 42, 0.65);
    /* Darker glass for readability */
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-highlight: rgba(255, 255, 255, 0.2);
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --gold: #fbbf24;
    --accent-red: rgba(239, 68, 68, 0.9);
    /* More vivid red */
    --status-online: #10b981;
    --bg-color: #030712;
    --user-msg: rgba(30, 41, 59, 0.85);
    /* Solid dark slate for user text */
    --bot-msg: rgba(127, 29, 29, 0.75);
    /* Solid dark red for bot */
    --font-heading: 'Roboto', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    /* Liquid glass smooth font rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Deep Space Glassmorphism Background */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    overflow: hidden;
    background-color: #030712;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center center;
}

/* Subtle premium ambient light */
.background-effects::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 100vh;
    background: radial-gradient(ellipse at top, rgba(56, 189, 248, 0.12) 0%, transparent 65%);
    pointer-events: none;
}

.background-effects::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 50vh;
    background: radial-gradient(ellipse at bottom left, rgba(139, 92, 246, 0.12) 0%, transparent 60%);
    pointer-events: none;
}

/* Typography */
.heading {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 2.5rem;
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 3rem;
    letter-spacing: -1px;
    background: linear-gradient(to right, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--gold), #d97706);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Shared Glass Styles */
.glass-panel,
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(40px) saturate(150%);
    -webkit-backdrop-filter: blur(40px) saturate(150%);
    border: 1px solid var(--glass-border);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), inset 0 1px 0 var(--glass-highlight);
}

.glass-card {
    border-radius: 32px;
    padding: 64px 48px;
    max-width: 600px;
    width: 90%;
}

.text-center {
    text-align: center;
}

/* Screens */
.screen {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(20px) scale(0.98);
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* Animations */
.fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.8s ease forwards;
    opacity: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.scale-up {
    animation: scaleUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: scale(0.9);
}

@keyframes scaleUp {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Buttons */
.liquid-btn,
.glass-btn,
.primary-btn {
    border: none;
    cursor: pointer;
    border-radius: 16px;
    font-weight: 600;
    font-family: 'Roboto', sans-serif;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    color: white;
}

.glass-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.btn-lg {
    padding: 20px 32px;
    font-size: 1.25rem;
    width: 200px;
}

.lang-options {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.primary-btn {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    padding: 16px 48px;
    font-size: 1.1rem;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.6);
}

.pulse-glow {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(59, 130, 246, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* Chat Layout */
.container {
    display: flex;
    gap: 24px;
    width: 95%;
    max-width: 1300px;
    height: 90vh;
}

.chat-section {
    flex: 2;
    display: flex;
    flex-direction: column;
    border-radius: 32px;
    overflow: hidden;
    position: relative;
}

.blur-header {
    background: rgba(15, 23, 42, 0.85);
    /* Darkened significantly */
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px 32px;
}

.trump-photo-large {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    margin: 0 auto 24px;
    overflow: hidden;
    border: 3px solid var(--gold);
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.3);
}

.trump-photo-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.trump-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--gold);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
    flex-shrink: 0;
}

.trump-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-info h1 {
    font-size: 1.4rem;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    margin-bottom: 4px;
}

.header-info .status {
    font-size: 0.85rem;
    color: var(--status-online);
    font-weight: 600;
}

/* Chat Box */
.chat-box {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    scroll-behavior: smooth;
}

.chat-box::-webkit-scrollbar {
    width: 6px;
}

.chat-box::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.message {
    max-width: 85%;
    padding: 18px 24px;
    border-radius: 24px;
    line-height: 1.6;
    animation: messageEnter 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(16px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    /* Text shadow for perfect readability */
    color: #ffffff;
}

@keyframes messageEnter {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message.system-intro {
    align-self: center;
    background: rgba(251, 191, 36, 0.05);
    border: 1px solid rgba(251, 191, 36, 0.2);
    color: #fcd34d;
    text-align: center;
    font-size: 0.95rem;
    max-width: 90%;
    border-radius: 16px;
}

.message.user {
    align-self: flex-end;
    background: var(--user-msg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom-right-radius: 8px;
}

.message.bot {
    align-self: flex-start;
    background: var(--bot-msg);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-bottom-left-radius: 8px;
    font-family: 'Roboto', sans-serif;
    font-size: 1.15rem;
}

.message.system-hint {
    align-self: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    color: #94a3b8;
    text-align: center;
    font-size: 0.95rem;
    font-style: italic;
    max-width: 90%;
    border-radius: 16px;
    padding: 12px 20px;
    margin: 8px 0;
    box-shadow: none;
}

/* Typing Indicator */
.typing-indicator {
    padding: 0 32px 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
    opacity: 0.7;
}

.typing-indicator span {
    animation: blink 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

.typing-indicator span:nth-child(4) {
    animation-delay: 0.6s;
}

/* Input Footer */
.blur-footer {
    background: rgba(15, 23, 42, 0.85);
    /* Darkened */
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--glass-border);
    padding: 24px 32px;
    display: flex;
    gap: 16px;
}

#userInput {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 16px 24px;
    color: white;
    font-size: 1.05rem;
    outline: none;
    transition: all 0.3s;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    resize: none;
    overflow-y: hidden;
    min-height: 56px;
    max-height: 150px;
    line-height: 1.4;
}

#userInput::-webkit-scrollbar {
    width: 6px;
}

#userInput::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

#userInput:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.inactivity-tooltip {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 32px;
    right: 90px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: 12px 20px;
    border-radius: 16px;
    color: var(--text-secondary);
    font-size: 0.9em;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
    z-index: 10;
    text-align: center;
}

.inactivity-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.send-btn {
    width: 60px;
    height: 60px;
    border-radius: 20px;
    background: linear-gradient(135deg, #3b82f6, #4f46e5);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.send-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.5);
}

/* Proof Section */
.proof-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 320px;
    border-radius: 32px;
    overflow: hidden;
}

.proof-header {
    padding: 24px 32px;
    position: relative;
}

.proof-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.proof-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.tooltip {
    position: absolute;
    top: 24px;
    right: 24px;
    cursor: pointer;
}

.info-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    font-size: 12px;
    font-weight: bold;
}

.tooltiptext {
    visibility: hidden;
    width: 260px;
    background: rgba(30, 41, 59, 0.95);
    color: #fff;
    text-align: center;
    border-radius: 12px;
    padding: 16px;
    position: absolute;
    z-index: 100;
    top: 130%;
    right: 0;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    transform: translateY(-10px);
    font-size: 0.85rem;
    line-height: 1.5;
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.proof-log {
    flex: 1;
    padding: 24px 32px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.empty-proofs {
    color: var(--text-secondary);
    text-align: center;
    margin-top: 40px;
    font-size: 0.95rem;
}

.proof-item {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-left: 4px solid #10b981;
    padding: 16px;
    border-radius: 12px;
    font-family: monospace;
    font-size: 0.85rem;
    word-break: break-all;
    animation: messageEnter 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.proof-item .lbl {
    color: #34d399;
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    font-family: 'Roboto', sans-serif;
}

/* Modal Override & Win Screen Polish */
.modal {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content.glass-card {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    max-width: 500px;
    padding: 40px;
    border-radius: 32px;
    text-align: center;
    position: relative;
    overflow: visible;
}

#winTitle {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b, #ef4444);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: pulse-glow 2s infinite alternate;
}

#winDesc {
    font-size: 1.15rem;
    color: #f8fafc;
    margin-bottom: 24px;
    line-height: 1.6;
}

#winQuote {
    font-style: italic;
    color: #cbd5e1;
    font-size: 1.05rem;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border-left: 4px solid #fbbf24;
    margin-bottom: 32px;
}

#restartBtn {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
    font-size: 1.2rem;
    padding: 16px 40px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#restartBtn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 30px rgba(16, 185, 129, 0.5);
}

.hidden {
    display: none !important;
}

@media (max-width: 900px) {
    .container {
        flex-direction: column;
        height: 100vh;
        width: 100%;
        border-radius: 0;
        gap: 0;
    }

    .glass-panel {
        border-radius: 0;
        border: none;
        border-bottom: 1px solid var(--glass-border);
    }

    .proof-section {
        flex: none;
        height: 35vh;
    }

    .chat-section {
        height: 65vh;
    }
}