/* ========================================
   Agent.ws — 3D Agent World
   Responsive + Mobile Optimized
   ======================================== */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-glass: rgba(18, 18, 26, 0.7);
    --bg-glass-hover: rgba(30, 30, 45, 0.8);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-strong: rgba(255, 255, 255, 0.15);
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6b6b7b;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-success: #10b981;
    --accent-danger: #ef4444;
    --accent-warning: #f59e0b;
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.2);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

html, body {
    width: 100%; height: 100%; overflow: hidden;
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-tap-highlight-color: transparent;
}

/* ========================================
   Loading Screen
   ======================================== */
#loading-screen {
    position: fixed; inset: 0; z-index: 10000;
    background: var(--bg-primary);
    display: flex; align-items: center; justify-content: center;
    flex-direction: column;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}
#loading-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loading-content { text-align: center; }
.loading-logo {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-weight: 800; letter-spacing: -0.02em; margin-bottom: 2rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.loading-bar-container {
    width: min(280px, 70vw); height: 4px;
    background: rgba(255,255,255,0.05); border-radius: 2px;
    overflow: hidden; margin: 0 auto 1rem;
}
.loading-bar {
    width: 0%; height: 100%; background: var(--gradient-primary); border-radius: 2px;
    animation: loadingProgress 2.5s ease-in-out forwards;
}
@keyframes loadingProgress {
    0% { width: 0%; } 50% { width: 70%; } 100% { width: 100%; }
}
.loading-text { color: var(--text-muted); font-size: 0.875rem; font-family: var(--font-mono); }

/* ========================================
   3D Canvas
   ======================================== */
#canvas-container { position: fixed; inset: 0; z-index: 0; }
#canvas-container canvas { display: block; width: 100% !important; height: 100% !important; }

/* ========================================
   UI Overlay
   ======================================== */
#ui-overlay {
    position: fixed; inset: 0; z-index: 10;
    pointer-events: none; display: flex; flex-direction: column;
    opacity: 1; transition: opacity 0.5s ease;
}
#ui-overlay.hidden { opacity: 0; }
#ui-overlay > * { pointer-events: auto; }
#ui-overlay .center-area { pointer-events: none; }

/* ========================================
   Glass Components
   ======================================== */
.glass-header, .glass-card, .glass-modal {
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border: 1px solid var(--border-glass);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05);
}
.glass-card {
    border-radius: var(--radius-md); padding: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.glass-card:hover {
    background: var(--bg-glass-hover);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), var(--shadow-glow);
}

/* ========================================
   Header
   ======================================== */
.glass-header {
    position: fixed; top: 0.5rem; left: 0.5rem; right: 0.5rem; z-index: 100;
    border-radius: var(--radius-lg);
    padding: 0.625rem 1rem;
    display: flex; align-items: center; justify-content: space-between;
}
.header-left { display: flex; align-items: center; gap: 1.5rem; }
.logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1rem; }
.logo-icon { color: var(--accent-primary); font-size: 1.1rem; }
.header-nav { display: flex; gap: 0.25rem; }
.nav-link {
    padding: 0.5rem 1rem; border-radius: var(--radius-sm);
    color: var(--text-secondary); text-decoration: none;
    font-size: 0.875rem; font-weight: 500; transition: all 0.2s ease;
}
.nav-link:hover, .nav-link.active { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.header-right { display: flex; align-items: center; gap: 0.5rem; }

.btn-buy, .btn-connect, .btn-swap, .btn-auth, .btn-menu, .btn-social {
    padding: 0.5rem 1rem; border-radius: var(--radius-sm); border: none;
    font-family: var(--font-sans); font-weight: 600; font-size: 0.8rem;
    cursor: pointer; transition: all 0.2s ease;
}
.btn-social {
    min-height: 2.1rem;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    color: var(--text-primary); text-decoration: none;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border-glass-strong);
}
.btn-social:hover {
    background: rgba(255,255,255,0.13);
    transform: translateY(-1px);
}
.btn-twitter { color: #ffffff; }
.btn-dex { color: #8ef7c8; }
.social-icon {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    line-height: 1;
}
.social-label { white-space: nowrap; }
.btn-buy {
    background: var(--gradient-primary); color: white;
    box-shadow: 0 4px 15px rgba(99,102,241,0.3);
}
.btn-buy:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,0.4); }
.btn-connect {
    background: rgba(255,255,255,0.08); color: var(--text-primary);
    border: 1px solid var(--border-glass-strong);
}
.btn-connect:hover { background: rgba(255,255,255,0.12); }
.btn-menu {
    background: rgba(255,255,255,0.08); color: var(--text-primary);
    border: 1px solid var(--border-glass-strong); font-size: 1.1rem; padding: 0.4rem 0.7rem;
}

/* ========================================
   Mobile Panel Toggle
   ======================================== */
.mobile-panel-toggle {
    position: fixed; bottom: 5.5rem; left: 50%; transform: translateX(-50%);
    z-index: 90; display: flex; gap: 0.4rem;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(12px);
    padding: 0.4rem; border-radius: 50px;
    border: 1px solid var(--border-glass);
}
.toggle-btn {
    width: 40px; height: 40px; border-radius: 50%; border: none;
    background: transparent; font-size: 1.1rem; cursor: pointer;
    transition: all 0.2s ease;
}
.toggle-btn.active { background: var(--gradient-primary); }

/* ========================================
   Main Layout
   ======================================== */
.main-layout {
    display: flex; flex: 1;
    padding: 4.5rem 0.5rem 5.5rem; gap: 0.5rem; height: 100vh;
}
.panel-left, .panel-right {
    width: 280px; display: flex; flex-direction: column; gap: 0.5rem; z-index: 10;
}
.panel-left { margin-top: 0.5rem; }
.panel-right { margin-top: 0.5rem; }
.center-area { flex: 1; position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 0.5rem 0; }

/* ========================================
   Cards
   ======================================== */
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.6rem; }
.card-title {
    font-weight: 600; font-size: 0.8rem; margin-bottom: 0.6rem;
    color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em;
}
.token-info { display: flex; align-items: center; gap: 0.6rem; }
.token-icon { font-size: 1.3rem; }
.token-name { font-weight: 700; font-size: 0.95rem; }
.token-price { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-secondary); }
.price-change {
    font-family: var(--font-mono); font-weight: 600; font-size: 0.8rem;
    padding: 0.2rem 0.5rem; border-radius: var(--radius-sm);
}
.price-change.positive { color: var(--accent-success); background: rgba(16,185,129,0.1); }
.price-change.negative { color: var(--accent-danger); background: rgba(239,68,68,0.1); }
.chart-container { height: 100px; margin-bottom: 0.4rem; position: relative; overflow: hidden; }
.stats-row { display: flex; justify-content: space-between; gap: 0.4rem; }
.stat { text-align: center; flex: 1; }
.stat-label { font-size: 0.6rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.2rem; }
.stat-value { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600; }

/* ========================================
   Agent List
   ======================================== */
.agent-list { display: flex; flex-direction: column; gap: 0.4rem; }
.agent-item {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.4rem; border-radius: var(--radius-sm);
    transition: background 0.2s ease; cursor: pointer;
}
.agent-item:hover { background: rgba(255,255,255,0.05); }
.agent-avatar {
    width: 1.8rem; height: 1.8rem; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6rem; font-weight: 700; color: white; flex-shrink: 0;
}
.agent-info { flex: 1; min-width: 0; }
.agent-name { font-size: 0.8rem; font-weight: 600; }
.agent-action { font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-status { width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--accent-success); box-shadow: 0 0 6px var(--accent-success); flex-shrink: 0; }
.agent-status.away { background: var(--accent-warning); box-shadow: 0 0 6px var(--accent-warning); }

/* ========================================
   World Info
   ======================================== */
.world-info { display: flex; justify-content: space-between; align-items: center; padding: 0 0.5rem; }
.location-badge {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.4rem 0.8rem; background: rgba(0,0,0,0.4); backdrop-filter: blur(10px);
    border-radius: var(--radius-sm); border: 1px solid var(--border-glass);
    font-size: 0.8rem; font-weight: 500;
}
.location-dot { width: 0.4rem; height: 0.4rem; background: var(--accent-success); border-radius: 50%; box-shadow: 0 0 6px var(--accent-success); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.world-stats { padding: 0.4rem 0.8rem; background: rgba(0,0,0,0.4); backdrop-filter: blur(10px); border-radius: var(--radius-sm); border: 1px solid var(--border-glass); font-size: 0.8rem; color: var(--text-secondary); }
.world-stats span { color: var(--text-primary); font-weight: 600; }

/* ========================================
   Exchange Card
   ======================================== */
.exchange-content { display: flex; align-items: center; gap: 0.8rem; }
.exchange-visual { flex-shrink: 0; }
.exchange-ring {
    width: 50px; height: 50px; position: relative;
    border: 2px solid var(--border-glass-strong); border-radius: 50%;
    animation: spin 10s linear infinite;
}
.ring-dot {
    position: absolute; width: 5px; height: 5px; background: var(--accent-primary);
    border-radius: 50%; top: 50%; left: 50%;
    transform: rotate(var(--angle)) translateX(21px) translate(-50%, -50%);
    box-shadow: 0 0 6px var(--accent-primary);
}
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.exchange-info { flex: 1; }
.exchange-status { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.2rem; }
.exchange-pair { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600; color: var(--accent-primary); }
.exchange-volume { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.2rem; }

/* ========================================
   Skills
   ======================================== */
.skills-list { display: flex; flex-direction: column; gap: 0.5rem; }
.skill-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.3rem; border-radius: var(--radius-sm); transition: background 0.2s ease; }
.skill-item:hover { background: rgba(255,255,255,0.05); }
.skill-icon { font-size: 1.1rem; width: 1.6rem; text-align: center; }
.skill-details { flex: 1; }
.skill-name { font-size: 0.8rem; font-weight: 500; margin-bottom: 0.2rem; display: flex; justify-content: space-between; }
.skill-bar { height: 4px; background: rgba(255,255,255,0.05); border-radius: 2px; overflow: hidden; }
.skill-progress { height: 100%; background: var(--gradient-primary); border-radius: 2px; transition: width 0.5s ease; }
.skill-level { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); }

/* ========================================
   Chat
   ======================================== */
.chat-card { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-messages {
    flex: 1; overflow-y: auto; display: flex; flex-direction: column;
    gap: 0.4rem; margin-bottom: 0.6rem; padding-right: 0.2rem; min-height: 80px;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border-glass-strong); border-radius: 2px; }
.chat-msg { font-size: 0.78rem; line-height: 1.4; word-break: break-word; }
.chat-msg.system { color: var(--text-muted); font-style: italic; }
.chat-user { font-weight: 600; }
.chat-text { color: var(--text-secondary); }
.chat-input-area { display: flex; gap: 0.4rem; }
.chat-input {
    flex: 1; background: rgba(255,255,255,0.05); border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm); padding: 0.4rem 0.6rem; color: var(--text-primary);
    font-family: var(--font-sans); font-size: 0.8rem; outline: none; transition: border-color 0.2s ease;
}
.chat-input:focus { border-color: var(--accent-primary); }
.chat-input::placeholder { color: var(--text-muted); }
.chat-send {
    width: 2rem; height: 2rem; border-radius: var(--radius-sm); border: none;
    background: var(--gradient-primary); color: white; font-size: 0.9rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease; flex-shrink: 0;
}
.chat-send:hover { transform: scale(1.05); }

/* ========================================
   Bottom Bar
   ======================================== */
.bottom-bar {
    position: fixed; bottom: 0.5rem; left: 0.5rem; right: 0.5rem;
    display: flex; justify-content: space-between; align-items: flex-end;
    z-index: 100; pointer-events: none;
}
.bottom-bar > * { pointer-events: auto; }
.wallet-card { border-radius: var(--radius-md); padding: 0.7rem 1rem; min-width: 180px; }
.wallet-label { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 0.2rem; }
.wallet-address { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-secondary); margin-bottom: 0.3rem; }
.wallet-balance { display: flex; align-items: baseline; gap: 0.3rem; }
.balance-amount { font-family: var(--font-mono); font-size: 1.1rem; font-weight: 700; }
.balance-token { font-size: 0.8rem; color: var(--text-muted); }
.pk-btn { position: absolute; top: 0.4rem; right: 0.4rem; background: rgba(255,255,255,0.08); border: 1px solid var(--border-glass); border-radius: var(--radius-sm); padding: 0.2rem 0.4rem; font-size: 0.75rem; cursor: pointer; transition: all 0.2s; }
.pk-btn:hover { background: rgba(255,255,255,0.15); }
.wallet-card { position: relative; }
.controls-hint {
    padding: 0.6rem 0.8rem; background: rgba(0,0,0,0.4); backdrop-filter: blur(10px);
    border-radius: var(--radius-sm); border: 1px solid var(--border-glass);
    font-size: 0.7rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.6rem;
    pointer-events: none;
}
.key { padding: 0.1rem 0.3rem; background: rgba(255,255,255,0.08); border-radius: 4px; border: 1px solid var(--border-glass); font-family: var(--font-mono); font-size: 0.6rem; }

/* ========================================
   Modal
   ======================================== */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.glass-modal { position: relative; width: 100%; max-width: 400px; border-radius: var(--radius-lg); padding: 1.25rem; animation: modalIn 0.3s ease; }
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.modal-header h3 { font-size: 1.05rem; font-weight: 700; }
.modal-close { width: 1.8rem; height: 1.8rem; border-radius: 50%; border: none; background: rgba(255,255,255,0.05); color: var(--text-secondary); font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s ease; }
.modal-close:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }

/* Swap Interface */
.swap-interface { display: flex; flex-direction: column; gap: 0.6rem; }
.swap-from, .swap-to { background: rgba(0,0,0,0.2); border-radius: var(--radius-md); padding: 0.8rem; border: 1px solid var(--border-glass); }
.swap-from label, .swap-to label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.4rem; display: block; }
.swap-input-group { display: flex; align-items: center; gap: 0.6rem; }
.swap-input-group input { flex: 1; background: transparent; border: none; color: var(--text-primary); font-family: var(--font-mono); font-size: 1.3rem; font-weight: 600; outline: none; width: 100%; }
.swap-token { padding: 0.3rem 0.6rem; background: rgba(255,255,255,0.08); border-radius: var(--radius-sm); font-weight: 600; font-size: 0.8rem; }
.swap-balance { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.4rem; }
.swap-arrow { text-align: center; font-size: 1.1rem; color: var(--text-muted); }
.swap-details { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.5rem 0; }
.detail-row { display: flex; justify-content: space-between; font-size: 0.8rem; }
.detail-row span:first-child { color: var(--text-muted); }
.detail-row span:last-child { color: var(--text-secondary); font-family: var(--font-mono); }
.btn-swap { width: 100%; padding: 0.875rem; background: var(--gradient-primary); color: white; border-radius: var(--radius-md); font-size: 0.95rem; box-shadow: 0 4px 15px rgba(99,102,241,0.3); }
.btn-swap:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,0.4); }

/* ========================================
   Auth Modal
   ======================================== */
.auth-modal { max-width: 360px; padding-top: 1.5rem; }
.auth-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border-glass); padding-bottom: 0.5rem; }
.auth-tab { flex: 1; padding: 0.5rem; border: none; background: transparent; color: var(--text-muted); font-family: var(--font-sans); font-weight: 600; font-size: 0.9rem; cursor: pointer; border-radius: var(--radius-sm); transition: all 0.2s; }
.auth-tab.active { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.auth-form { display: flex; flex-direction: column; gap: 0.8rem; }
.auth-form.hidden { display: none; }
.form-group { display: flex; flex-direction: column; gap: 0.3rem; }
.form-group label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.form-group input {
    padding: 0.6rem 0.8rem; background: rgba(0,0,0,0.2); border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm); color: var(--text-primary); font-family: var(--font-sans);
    font-size: 0.875rem; outline: none; transition: border-color 0.2s;
}
.form-group input:focus { border-color: var(--accent-primary); }
.form-group input::placeholder { color: var(--text-muted); }
.btn-auth { width: 100%; padding: 0.75rem; background: var(--gradient-primary); color: white; border-radius: var(--radius-md); font-size: 0.9rem; }
.auth-error { color: var(--accent-danger); font-size: 0.8rem; text-align: center; min-height: 1.2rem; }
.auth-close { position: absolute; top: 0.75rem; right: 0.75rem; }

/* ========================================
   Toast
   ======================================== */
#toast-container { position: fixed; top: 4.5rem; right: 0.5rem; z-index: 1001; display: flex; flex-direction: column; gap: 0.4rem; }
.toast {
    padding: 0.7rem 1rem; background: var(--bg-glass); backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass); border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3); font-size: 0.8rem;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 3s forwards; max-width: 280px;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(20px); } }
.toast.success { border-left: 3px solid var(--accent-success); }
.toast.error { border-left: 3px solid var(--accent-danger); }
.toast.info { border-left: 3px solid var(--accent-primary); }

/* ========================================
   Mobile Responsive
   ======================================== */
.mobile-only { display: none !important; }
.desktop-only { display: flex !important; }

@media (max-width: 1024px) {
    .panel-left, .panel-right { width: 240px; }
}

@media (max-width: 768px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: flex !important; }
    
    .glass-header { padding: 0.5rem 0.75rem; top: 0.25rem; left: 0.25rem; right: 0.25rem; }
    .logo-text { display: none; }
    .btn-buy { padding: 0.4rem 0.7rem; font-size: 0.7rem; }
    .btn-connect { padding: 0.4rem 0.7rem; font-size: 0.7rem; }
    .header-left { gap: 0.5rem; }
    .header-right { gap: 0.35rem; }
    .btn-social {
        width: 2.25rem; height: 2.25rem; min-height: 2.25rem;
        padding: 0; border-radius: var(--radius-sm);
    }
    .btn-dex .social-icon { font-size: 0.58rem; }
    .social-label { display: none; }
    
    .main-layout { padding: 3.8rem 0.25rem 0; }
    
    .panel-left, .panel-right {
        position: fixed; bottom: 0; left: 0; right: 0;
        width: 100%; height: 55vh; z-index: 50;
        background: rgba(10,10,15,0.95); backdrop-filter: blur(20px);
        padding: 1rem 1rem 6.5rem; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        border-top: 1px solid var(--border-glass);
        transform: translateY(100%); transition: transform 0.3s ease;
        margin-top: 0;
    }
    .panel-left.active, .panel-right.active { transform: translateY(0); }
    
    .panel-left { z-index: 51; }
    .panel-right { z-index: 52; }
    
    .chart-card, .agents-card, .exchange-card, .skills-card, .chat-card {
        background: rgba(18,18,26,0.9);
    }
    
    .center-area { padding: 0.25rem 0; }
    .world-info { padding: 0 0.25rem; }
    .location-badge, .world-stats { font-size: 0.7rem; padding: 0.3rem 0.6rem; }
    
    .bottom-bar { bottom: 0.25rem; left: 0.25rem; right: 0.25rem; z-index: 55; }
    .bottom-bar.panel-open { display: none; }
    .wallet-card { min-width: auto; padding: 0.6rem 0.8rem; }
    .balance-amount { font-size: 1rem; }
    
    .mobile-panel-toggle { display: flex !important; z-index: 60; }

    .mobile-keypad {
        position: fixed; left: 1rem; bottom: 5.25rem; z-index: 48;
        width: 9.5rem; height: 9.5rem; display: grid !important;
        grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
        gap: 0.3rem; touch-action: none; user-select: none; -webkit-user-select: none;
    }
    .move-key {
        border: 1px solid rgba(255,255,255,0.25); border-radius: 0.8rem;
        color: #fff; background: rgba(15,15,25,0.72); backdrop-filter: blur(12px);
        font-size: 1.1rem; box-shadow: 0 5px 18px rgba(0,0,0,0.25);
        touch-action: none; -webkit-tap-highlight-color: transparent;
    }
    .move-key.pressed { background: var(--accent-primary); transform: scale(0.94); }
    .move-up { grid-column: 2; grid-row: 1; }
    .move-left { grid-column: 1; grid-row: 2; }
    .move-down { grid-column: 2; grid-row: 2; }
    .move-right { grid-column: 3; grid-row: 2; }
    
    .glass-modal { max-width: 92vw; padding: 1rem; }
    .auth-modal { max-width: 92vw; }
}

@media (max-width: 480px) {
    .chart-container { height: 80px; }
    .stats-row { gap: 0.2rem; }
    .stat-label { font-size: 0.55rem; }
    .stat-value { font-size: 0.7rem; }
    .chat-card { min-height: 120px; }
    .skills-list { gap: 0.3rem; }
    .skill-icon { font-size: 1rem; width: 1.4rem; }
    .agent-avatar { width: 1.6rem; height: 1.6rem; font-size: 0.55rem; }
    .agent-name { font-size: 0.75rem; }
    .agent-action { font-size: 0.65rem; }
}

/* ========================================
   Wallet Selector
   ======================================== */
.wallet-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
    animation: fadeIn 0.2s ease;
}
.wallet-option {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 0.7rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}
.wallet-option:hover {
    background: var(--bg-glass-hover);
    border-color: var(--accent-primary);
}

/* ========================================
   Utility
   ======================================== */
.hidden { display: none !important; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
