/* BRYSTACK IA — preto + dourado, mais imponente */
:root {
  --gold: #d4af37;
  --gold-light: #f1d97e;
  --dark: #050507;
  --panel: #0c0c10;
  --panel2: #121218;
  --border: rgba(212, 175, 55, .25);
  --text: #e9e4d8;
  --muted: #9a9488;
  --err: #ff6b6b;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: radial-gradient(ellipse at top, #101016 0%, var(--dark) 60%);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  overflow: hidden;
}
.gold { color: var(--gold); }

/* ============ INTRO ============ */
.intro-screen {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, #0e0e14 0%, #050507 70%);
  animation: introFade 1s ease;
}
@keyframes introFade { from { opacity: 0; } to { opacity: 1; } }
.intro-logo-wrap {
  width: 150px; height: 150px; border-radius: 34px; overflow: hidden;
  border: 3px solid var(--gold);
  box-shadow: 0 0 45px rgba(212, 175, 55, .35), 0 0 120px rgba(212, 175, 55, .15);
  animation: logoPulse 3s ease-in-out infinite;
}
@keyframes logoPulse {
  0%, 100% { box-shadow: 0 0 45px rgba(212,175,55,.35), 0 0 120px rgba(212,175,55,.15); }
  50% { box-shadow: 0 0 65px rgba(212,175,55,.55), 0 0 160px rgba(212,175,55,.3); }
}
.intro-logo { width: 100%; height: 100%; object-fit: cover; }
.intro-title { font-size: 52px; font-weight: 800; letter-spacing: 4px; margin-top: 28px; }
.intro-tagline { color: var(--gold-light); font-size: 16px; letter-spacing: 6px; margin-top: 6px; }
.intro-sub { color: var(--muted); font-size: 14px; margin-top: 18px; }
.enter-btn {
  margin-top: 42px; padding: 16px 64px; font-size: 18px; font-weight: 700;
  letter-spacing: 3px; color: #050507; background: linear-gradient(135deg, var(--gold-light), var(--gold));
  border: none; border-radius: 60px; cursor: pointer;
  box-shadow: 0 0 30px rgba(212, 175, 55, .4);
  transition: transform .2s;
}
.enter-btn:hover { transform: scale(1.05); }
.intro-foot { position: absolute; bottom: 18px; color: var(--muted); font-size: 12px; letter-spacing: 2px; }

/* ============ AVATAR OVERLAY ============ */
.avatar-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: radial-gradient(ellipse at center, #0b0b12 0%, #030305 80%);
  display: flex; align-items: center; justify-content: center;
}
.avatar-overlay.hidden { display: none; }
.avatar-stage { position: relative; display: flex; flex-direction: column; align-items: center; }
#avatarImg {
  height: 78vh; max-height: 640px; object-fit: contain;
  filter: drop-shadow(0 0 40px rgba(212, 175, 55, .28));
  transition: filter .3s;
}
.avatar-glow {
  position: absolute; bottom: -6%; width: 60%; height: 30px;
  background: radial-gradient(ellipse, rgba(212, 175, 55, .5), transparent 70%);
}
/* estados animados */
#avatarImg.listening { animation: listenSway 2.6s ease-in-out infinite; }
#avatarImg.thinking { animation: thinkPulse 1.1s ease-in-out infinite; }
#avatarImg.speaking  { animation: speakBounce .85s ease-in-out infinite; }
@keyframes listenSway {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  30% { transform: rotate(-1.6deg) translateY(-4px); }
  70% { transform: rotate(1.2deg) translateY(3px); }
}
@keyframes thinkPulse {
  0%, 100% { filter: drop-shadow(0 0 40px rgba(212,175,55,.28)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 90px rgba(212,175,55,.7)); transform: scale(1.015); }
}
@keyframes speakBounce {
  0%, 100% { transform: translateY(0) scale(1); filter: drop-shadow(0 0 40px rgba(212,175,55,.28)); }
  35% { transform: translateY(-7px) scale(1.012); filter: drop-shadow(0 0 70px rgba(212,175,55,.6)); }
  70% { transform: translateY(3px) scale(.995); filter: drop-shadow(0 0 45px rgba(212,175,55,.35)); }
}
.avatar-status {
  margin-top: 14px; font-size: 15px; letter-spacing: 3px; color: var(--gold-light);
  text-transform: uppercase; min-height: 22px;
}
.avatar-close {
  position: absolute; top: 16px; right: 18px; width: 44px; height: 44px;
  background: rgba(20, 20, 26, .85); border: 1px solid var(--border);
  color: var(--gold); font-size: 20px; border-radius: 50%; cursor: pointer; z-index: 2;
}
.avatar-talk-hint {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: rgba(212, 175, 55, .12); border: 1px solid var(--border);
  color: var(--gold-light); padding: 10px 26px; border-radius: 40px; font-size: 14px;
  letter-spacing: 1px;
}

/* ============ APP ============ */
.app-screen { display: flex; flex-direction: column; height: 100vh; }
.app-screen.hidden { display: none; }
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; background: var(--panel); border-bottom: 1px solid var(--border);
}
.hdr-brand { display: flex; align-items: center; gap: 12px; }
.hdr-brand img { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); object-fit: cover; }
.hdr-name { display: block; font-size: 17px; font-weight: 800; letter-spacing: 1.5px; }
.hdr-sub { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.hdr-actions { display: flex; gap: 10px; }
.btn-ghost {
  background: transparent; border: 1px solid var(--border); color: var(--text);
  padding: 8px 16px; border-radius: 24px; font-size: 13px; cursor: pointer;
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: #050507;
  border: none; padding: 8px 18px; border-radius: 24px; font-size: 13px; font-weight: 700; cursor: pointer;
}

.chat-area {
  flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px;
}
.msg { max-width: 78%; padding: 13px 17px; border-radius: 18px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.msg.user {
  align-self: flex-end; background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: #050507;
  border-bottom-right-radius: 5px; font-weight: 500;
}
.msg.bot {
  align-self: flex-start; background: var(--panel2); border: 1px solid var(--border);
  border-bottom-left-radius: 5px;
}
.msg.err { align-self: flex-start; background: rgba(255, 107, 107, .1); border: 1px solid rgba(255, 107, 107, .4); color: var(--err); }
.msg img { max-width: 100%; border-radius: 12px; margin-top: 8px; border: 1px solid var(--border); }
.msg video { max-width: 100%; border-radius: 12px; margin-top: 8px; border: 1px solid var(--border); }

.quick-actions { display: flex; gap: 8px; padding: 8px 14px; overflow-x: auto; }
.quick-actions button {
  flex: none; background: var(--panel2); border: 1px solid var(--border); color: var(--text);
  padding: 8px 14px; border-radius: 20px; font-size: 12.5px; cursor: pointer; white-space: nowrap;
}
.quick-actions button:hover { border-color: var(--gold); color: var(--gold); }

.chat-input {
  display: flex; align-items: flex-end; gap: 8px; padding: 10px 14px 14px;
  background: var(--panel); border-top: 1px solid var(--border);
}
.input-icon {
  font-size: 22px; cursor: pointer; padding: 8px 6px; color: var(--muted);
}
#msgInput {
  flex: 1; background: var(--panel2); border: 1px solid var(--border); color: var(--text);
  border-radius: 24px; padding: 11px 16px; font-size: 15px; resize: none;
  max-height: 120px; outline: none; font-family: inherit;
}
#msgInput:focus { border-color: var(--gold); }
.mic-btn {
  font-size: 20px; background: var(--panel2); border: 1px solid var(--border);
  color: var(--gold); width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
}
.mic-btn.active { background: rgba(212, 175, 55, .18); border-color: var(--gold); animation: micPulse 1s infinite; }
@keyframes micPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(212,175,55,.4); } 50% { box-shadow: 0 0 0 9px rgba(212,175,55,0); } }
.send-btn {
  font-size: 18px; background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #050507; border: none; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; font-weight: 800;
}

.img-preview { padding: 0 14px; position: relative; background: var(--panel); }
.img-preview.hidden { display: none; }
.img-preview img { max-height: 110px; border-radius: 10px; border: 1px solid var(--border); margin-top: 6px; }
.typing-dot { display: inline-block; animation: blink 1s infinite; color: var(--gold); }
@keyframes blink { 0%,100% { opacity: .3; } 50% { opacity: 1; } }

@media (max-width: 640px) {
  .intro-title { font-size: 38px; }
  #avatarImg { height: 68vh; }
  .hdr-actions .btn-ghost { display: none; }
}
