/* ======= Theme ======= */
:root{
  --pink:#ff5ca8;      /* main accent */
  --pink-2:#ff8ec6;    /* lighter accent */
  --ink:#000000;       /* background base */
  --panel:#0b0007;     /* panel bg */
  --line:#3a0c25;      /* borders */
  --text:#f1d5e8;      /* primary text */
  --muted:#c88aad;     /* secondary text */
}

/* ======= Base ======= */
*{ box-sizing:border-box; }
html,body{ height:100%; }

/* ======= Background: tiled AIM GIF ======= */
body{
  margin:0;
  color:var(--text);
  font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
  background:
    url("https://media.giphy.com/media/DOitPFO8XSUcU/giphy.gif")
    center top / 360px auto repeat var(--ink); /* smaller size = more tiles */
}

/* Dim/pink overlay for readability above the GIF */
body::after{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(255,92,168,.18) 0%, rgba(0,0,0,0) 60%),
    radial-gradient(800px 500px at 110% 0%, rgba(255,92,168,.10) 0%, rgba(0,0,0,0) 50%),
    rgba(0,0,0,.55);
  z-index:0; /* behind content */
}

/* ======= Layout ======= */
.page{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  gap:16px;
  flex-direction:column;

  position:relative; /* ensure above overlay */
  z-index:1;
}

/* ======= Ad ======= */
.ad{
  width:100%;
  display:flex;
  justify-content:center;
}
.ad img{
  width:360px;
  max-width:92vw;
  display:block;
  border:2px solid var(--pink);
  border-radius:12px;
  box-shadow:0 0 30px rgba(255,92,168,.25);
}

/* ======= AIM Window ======= */
.aim-window{
  width:360px;
  max-width:92vw;
  background:var(--panel);
  border:2px solid var(--pink);
  border-radius:12px;
  overflow:hidden;
  box-shadow:0 0 40px rgba(255,92,168,.25), 0 10px 40px rgba(0,0,0,.6);
}

/* Title bar */
.titlebar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 12px;
  background:linear-gradient(180deg, var(--pink) 0%, var(--pink-2) 100%);
  color:#230012;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.6px;
}
.window-controls button{
  width:24px; height:20px;
  margin-left:6px;
  border:none;
  border-radius:4px;
  background:#ffd1e6;
  color:#3b0a22;
  font-weight:700;
  cursor:default;
}

/* Me (signed-in block) */
.me{
  display:flex;
  gap:12px;
  padding:12px;
  border-bottom:1px solid var(--line);
}
.me-avatar img{
  width:48px; height:48px;
  border-radius:8px;
  border:2px solid var(--pink);
  object-fit:cover;
}
.me-username{ font-weight:800; }
.me-status{ color:var(--muted); font-size:.95rem; }
.glitter img{ display:block; margin-top:6px; border:0; }

/* Search (disabled for look) */
.search{ padding:8px 12px; }
.search input{
  width:100%;
  padding:8px 10px;
  border-radius:8px;
  border:1px solid var(--line);
  background:#180013;
  color:#f1d5e8;
}

/* Buddy list */
.buddy-list{
  list-style:none;
  margin:0;
  padding:6px 6px 10px;
  max-height:260px;
  overflow:auto;
}
.buddy{
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 8px;
  border-radius:8px;
}
.buddy:hover{ background:rgba(255,92,168,.10); }
.dot{
  width:10px; height:10px;
  border-radius:50%;
  background:#666;
  box-shadow:0 0 0 1px #000 inset;
}
.dot.online{ background:#5cff5c; box-shadow:0 0 8px #5cff5c99; }
.dot.away{ background:#ffd166; box-shadow:0 0 8px #ffd16699; }

/* Footer */
.footer{
  font-size:.78rem;
  opacity:.75;
  padding:8px 12px 12px;
  border-top:1px solid var(--line);
}
/* ===== AIM-style pop-out IM window ===== */
.im-window{
  position:fixed;
  left:calc(50% - 180px);  /* initial drop point */
  top:120px;
  width:360px;
  max-width:92vw;
  max-height:72vh;
  display:flex;
  flex-direction:column;
  background:var(--panel);
  border:2px solid var(--pink);
  border-radius:12px;
  overflow:hidden;
  box-shadow:0 0 40px rgba(255,92,168,.25), 0 10px 40px rgba(0,0,0,.6);
}

.im-titlebar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 12px;
  background:linear-gradient(180deg, var(--pink) 0%, var(--pink-2) 100%);
  color:#230012;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.6px;
  cursor:grab;
}

.im-title{
  display:flex;
  align-items:center;
  gap:8px;
}
.im-title .dot{
  width:10px; height:10px; border-radius:50%;
  background:#5cff5c;
  box-shadow:0 0 8px #5cff5c99;
}

.im-controls{ display:flex; gap:6px; }
.im-controls button{
  border:0;
  width:28px; height:28px;
  border-radius:6px;
  font-weight:800;
  background:#ffd1e6;
  color:#3b0a22;
  cursor:pointer;
}
.im-controls button:hover{ filter:brightness(0.95); }

.im-messages{
  flex:1;
  overflow:auto;
  padding:12px;
  background:transparent;
}

.bubble{
  display:inline-block;
  max-width:78%;
  padding:8px 10px;
  margin:4px 0;
  border-radius:10px;
  line-height:1.25;
  word-wrap:break-word;
  clear:both;
}
.bubble .time{
  display:block;
  opacity:.6;
  font-size:.72rem;
  margin-top:4px;
}

.bubble.system{
  background:transparent;
  color:var(--muted);
  font-style:italic;
  margin:6px auto;
  text-align:center;
  max-width:100%;
}

.bubble.me{
  float:right;
  background:linear-gradient(180deg, var(--pink-2), var(--pink));
  color:#240015;
  border-top-right-radius:3px;
}
.bubble.them{
  float:left;
  background:#1b0b14;
  border:1px solid var(--line);
  color:var(--text);
  border-top-left-radius:3px;
}

.typing{
  float:left; clear:both;
  color:var(--muted);
  font-style:italic;
  padding:4px 2px;
}

.im-composer{
  border-top:1px solid var(--line);
  padding:10px;
  background:#150610;
}
.im-composer input{
  width:100%;
  padding:10px 12px;
  border-radius:8px;
  border:1px solid var(--line);
  background:#180013;
  color:var(--text);
}

/* collapsed = minimized */
.im-window.collapsed .im-messages,
.im-window.collapsed .im-composer{ display:none; }

/* small screens: a bit taller */
@media (max-width:600px){
  .im-window{ max-height:78vh; width:94vw; left:3vw; }
}
