:root{
  --bg1:#0b0f17;
  --bg2:#0f1830;
  --card:rgba(255,255,255,0.06);
  --card2:rgba(255,255,255,0.10);
  --line:rgba(255,255,255,0.12);
  --text:#e9eefc;
  --muted:rgba(233,238,252,0.65);
  --accent:#4f7cff;
  --accent2:#7a5cff;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color:var(--text);
  background:
    radial-gradient(900px 500px at 20% 10%, rgba(79,124,255,0.22), transparent 55%),
    radial-gradient(900px 500px at 85% 25%, rgba(122,92,255,0.20), transparent 55%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
  overflow:hidden;
}

/* Page fade-in */
@keyframes pageIn{
  from{ opacity:0; transform: translateY(10px); }
  to{ opacity:1; transform: translateY(0); }
}

.app{
  max-width:900px;
  margin:auto;
  height:100vh;
  display:flex;
  flex-direction:column;
  animation: pageIn 420ms ease-out both;
}

/* Header */
header{
  padding:14px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border-bottom:1px solid var(--line);
  background:rgba(0,0,0,0.12);
  backdrop-filter:blur(10px);
}

header h1{
  margin:0;
  font-size:18px;
  letter-spacing:0.2px;
}

.headerRight{
  display:flex;
  align-items:center;
  gap:8px;
}

.username{
  font-size:13px;
  color:var(--muted);
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--line);
  background:rgba(255,255,255,0.05);
  transition:transform 180ms ease, background 180ms ease;
}

.username:hover{
  transform:translateY(-1px);
  background:rgba(255,255,255,0.08);
}

/* Ghost button (Change name) */
.ghostBtn{
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(255,255,255,0.05);
  color:var(--muted);
  cursor:pointer;
  font-weight:700;
  transition:transform 140ms ease, background 140ms ease, color 140ms ease;
  box-shadow:none;
}

.ghostBtn:hover{
  transform:translateY(-2px);
  background:rgba(255,255,255,0.10);
  color:var(--text);
}

.ghostBtn:active{
  transform:scale(0.98);
}

/* Chat */
main{
  flex:1;
  overflow-y:auto;
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:10px;
  scroll-behavior:smooth;
}

/* Scrollbar */
main::-webkit-scrollbar{ width:10px; }
main::-webkit-scrollbar-thumb{
  background:rgba(255,255,255,0.14);
  border-radius:999px;
}

/* Message bubble */
.bubble{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:16px;
  padding:10px 12px;
  max-width:78%;
  box-shadow:0 8px 18px rgba(0,0,0,0.22);
  transition:transform 160ms ease, background 160ms ease;
}

.bubble:hover{
  transform:translateY(-2px) scale(1.01);
  background:var(--card2);
}

/* Pop-in animation */
@keyframes popIn{
  from{ opacity:0; transform:translateY(8px) scale(0.98); }
  to{ opacity:1; transform:translateY(0) scale(1); }
}

.bubble.incoming{
  animation:popIn 240ms ease-out both;
}

.name{
  font-size:12px;
  font-weight:800;
  margin-bottom:4px;
  opacity:0.85;
}

.creator-badge{
  font-size:11px;
  font-weight:700;
  margin:-2px 0 6px 0;
  color:#ff9a9a; /* light red */
  letter-spacing:0.3px;
  opacity:0.95;
}

.text{
  white-space:pre-wrap;
  line-height:1.3;
  font-size:14px;
}

/* Composer */
footer{
  padding:12px;
  display:flex;
  gap:10px;
  border-top:1px solid var(--line);
  background:rgba(0,0,0,0.12);
  backdrop-filter:blur(10px);
}

input{
  flex:1;
  padding:12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(255,255,255,0.06);
  color:var(--text);
  outline:none;
  transition:border-color 160ms ease, box-shadow 160ms ease;
}

input:focus{
  border-color:rgba(79,124,255,0.55);
  box-shadow:0 0 0 4px rgba(79,124,255,0.18);
}

/* Primary buttons (Send) */
button{
  padding:12px 14px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.12);
  background:linear-gradient(135deg,var(--accent),var(--accent2));
  color:white;
  cursor:pointer;
  font-weight:800;
  box-shadow:0 12px 28px rgba(79,124,255,0.25);
  transition:transform 140ms ease, box-shadow 140ms ease;
}

button:hover{
  transform:translateY(-2px);
  box-shadow:0 16px 36px rgba(79,124,255,0.35);
}

button:active{
  transform:scale(0.97);
}

/* Name page */
.center{
  justify-content:center;
  align-items:center;
  text-align:center;
  padding:16px;
}

.center input,
.center button{
  max-width:340px;
  width:100%;
  margin-top:12px;
}

@media (max-width:520px){
  .bubble{ max-width:92%; }
}
