:root {
    --bg: #000000;
    --red: #FF3131;
    --glass-bg: rgba(10, 10, 10, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
}

body {
    margin: 0; padding: 0; background: var(--bg); color: #fff;
    font-family: 'JetBrains Mono', monospace; 
    height: 100dvh; display: flex; flex-direction: column; overflow: hidden;
    position: relative; -webkit-font-smoothing: antialiased;
}

/* DESKTOP LOCKOUT */
#desktop-lockout {
    display: none; position: fixed; inset: 0; background: #000; z-index: 9999;
    flex-direction: column; align-items: center; justify-content: center; text-align: center;
    padding: 40px;
}
#desktop-lockout h1 { font-family: 'Anton', sans-serif; font-weight: normal; font-size: 80px; color: var(--red); margin: 0 0 20px 0; letter-spacing: 2px; line-height: 1; }
#desktop-lockout p { font-size: 16px; color: #888; max-width: 400px; line-height: 1.6; }

@media (min-width: 768px) {
    #app-container { display: none !important; }
    #desktop-lockout { display: flex; }
}

#app-container { display: flex; flex-direction: column; height: 100%; width: 100%; position: relative; }

/* Ambient Background Glow */
.ambient-glow {
    position: absolute; top: -150px; left: 50%; transform: translateX(-50%);
    width: 80vw; height: 400px; background: radial-gradient(circle, rgba(255, 49, 49, 0.15) 0%, transparent 60%);
    z-index: 0; pointer-events: none; filter: blur(40px);
}

/* Floating Header */
header {
    position: absolute; top: 0; left: 0; width: 100%; box-sizing: border-box;
    padding: env(safe-area-inset-top, 20px) 24px 15px;
    display: flex; justify-content: space-between; align-items: center;
    background: linear-gradient(to bottom, rgba(0,0,0,1) 30%, transparent);
    z-index: 10; pointer-events: none;
}
.logo-img { height: 20px; width: auto; object-fit: contain; pointer-events: auto; }
.wallet { 
    font-size: 11px; font-weight: bold; border: 1px solid var(--glass-border); 
    padding: 8px 16px; border-radius: 30px; background: var(--glass-bg); 
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    pointer-events: auto; cursor: pointer; transition: transform 0.1s;
}
.wallet:active { transform: scale(0.95); }

/* Chat Feed */
#chat-window {
    flex: 1; overflow-y: auto; z-index: 1;
    padding: calc(80px + env(safe-area-inset-top, 0px)) 24px calc(100px + env(safe-area-inset-bottom, 0px));
    display: flex; flex-direction: column; gap: 20px; scroll-behavior: smooth;
}
#chat-window::-webkit-scrollbar { display: none; }

.msg-row { display: flex; width: 100%; animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.msg-row.ai { justify-content: flex-start; }
.msg-row.user { justify-content: flex-end; }

@keyframes slideIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

/* Chat Bubbles */
.bubble {
    max-width: 85%; padding: 16px 20px; border-radius: 18px;
    font-size: 13px; line-height: 1.6; position: relative;
}
.sys-badge { font-size: 9px; color: var(--red); letter-spacing: 1.5px; margin-bottom: 8px; font-weight: bold; }
.ai .bubble { 
    background: var(--glass-bg); border: 1px solid var(--glass-border); 
    border-bottom-left-radius: 4px; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.user .bubble { 
    background: var(--red); color: #000; font-weight: bold; 
    border-bottom-right-radius: 4px; 
}

/* High-End App Cards */
.app-grid {
    display: flex; gap: 16px; overflow-x: auto; padding: 5px 0 20px 0;
    width: 100vw; margin-left: -24px; padding-left: 24px; scroll-snap-type: x mandatory;
}
.app-grid::-webkit-scrollbar { display: none; }

.app-card {
    min-width: 250px; background: rgba(15, 15, 15, 0.85); border: 1px solid var(--glass-border);
    border-radius: 20px; padding: 20px; scroll-snap-align: start;
    display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; 
    backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
}

.app-header { display: flex; align-items: center; gap: 14px; }
.app-icon { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; background: #111; display: flex; align-items: center; justify-content: center; font-size: 22px; border: 1px solid #222; }
.app-title-group { display: flex; flex-direction: column; }
.app-title { font-family: 'Anton', sans-serif; font-weight: normal; font-size: 22px; letter-spacing: 1px; margin: 0; color: #fff; line-height: 1.1; text-transform: uppercase; }
.app-dev { font-size: 9px; color: #666; font-weight: bold; letter-spacing: 0.5px; }
.app-desc { font-size: 12px; color: #A1A1A6; flex: 1; line-height: 1.5; }

.app-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.app-price { color: #fff; font-family: 'Anton', sans-serif; font-weight: normal; font-size: 18px; letter-spacing: 1px;}
.btn-install {
    background: #fff; color: #000; border: none; font-weight: bold;
    padding: 8px 20px; border-radius: 14px; font-family: 'JetBrains Mono';
    font-size: 13px; cursor: pointer; transition: transform 0.1s;
}
.btn-install:active { transform: scale(0.95); }

/* The Fixed Input Dock */
.input-dock {
    position: absolute; bottom: 0; left: 0; width: 100%; z-index: 50;
    padding: 10px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to top, rgba(0,0,0,0.95) 60%, transparent);
    box-sizing: border-box; pointer-events: none;
}
.input-wrapper {
    display: flex; gap: 10px; background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border); border-radius: 30px;
    padding: 6px; pointer-events: auto;
}
input[type="text"] {
    flex: 1; background: transparent; border: none;
    color: #fff; padding: 0 16px; font-family: 'JetBrains Mono', monospace; 
    font-size: 14px; outline: none;
}
input[type="text"]::placeholder { color: #555; }

.btn-send {
    background: var(--red); border: none; width: 40px; height: 40px; 
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: transform 0.2s; flex-shrink: 0;
}
.btn-send:active { transform: scale(0.9); }

/* PAYMENT BOTTOM SHEET */
.sheet-overlay {
    position: absolute; inset: 0; background: rgba(0,0,0,0.6); z-index: 100;
    opacity: 0; pointer-events: none; transition: opacity 0.3s; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
}
.payment-sheet {
    position: absolute; bottom: 0; left: 0; width: 100%;
    background: rgba(15, 15, 15, 0.95); backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
    border-radius: 24px 24px 0 0; padding: 32px 24px calc(env(safe-area-inset-bottom, 24px) + 24px);
    box-sizing: border-box; transform: translateY(100%); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 101; border-top: 1px solid var(--glass-border); text-align: center;
}
.payment-sheet.active { transform: translateY(0); }
.sheet-overlay.active { opacity: 1; pointer-events: auto; }

.sheet-grabber { width: 36px; height: 5px; background: rgba(255,255,255,0.2); border-radius: 3px; margin: -16px auto 24px auto; }
.payment-sheet h2 { font-family: 'Anton', sans-serif; font-weight: normal; font-size: 32px; margin: 0 0 10px 0; color: #fff; letter-spacing: 1px;}
.payment-sheet p { font-size: 12px; color: #888; margin-bottom: 24px; }

.amount-grid { display: flex; gap: 10px; justify-content: center; margin-bottom: 24px; }
.amount-btn {
    background: transparent; border: 1px solid var(--glass-border); color: #fff;
    padding: 12px 20px; border-radius: 12px; font-family: 'JetBrains Mono'; font-size: 16px;
    cursor: pointer; transition: all 0.2s; flex: 1;
}
.amount-btn.selected { background: var(--red); color: #000; border-color: var(--red); font-weight: bold; }

.btn-primary-pay {
    background: #fff; color: #000; border: none; border-radius: 16px; padding: 18px;
    font-size: 16px; font-weight: bold; width: 100%; font-family: 'JetBrains Mono';
    cursor: pointer; transition: transform 0.1s;
}
.btn-primary-pay:active { transform: scale(0.96); }
