/* Reset and Base */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Poppins', sans-serif; }
body {
  background: linear-gradient(135deg, #0a0f1c, #1e1b2e);
  color: #fff;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Loader */
#loading-screen {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: #0a0f1c;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: opacity 0.4s;
  z-index: 1000;
}
.loader {
  border: 4px solid #222;
  border-top: 4px solid #8b5cf6;
  border-radius: 50%;
  width: 50px; height: 50px;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { margin-top: 1rem; color: #8b5cf6; font-weight: 600; }

/* Header */
.app-header {
  text-align: center;
  padding: 1.5rem;
}
.app-header h1 { font-size: 1.8rem; font-weight: 700; }
.app-header span { color: #8b5cf6; }
.tutorial-btn {
  background: #8b5cf6;
  color: white;
  padding: 0.4rem 1rem;
  border: none;
  border-radius: 6px;
  margin-top: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
}

/* Cards */
.card {
  background: #1e1b2e;
  margin: 1rem auto;
  padding: 1.2rem;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.card h2 { margin-bottom: 1rem; text-align: center; }

label { display: block; margin-bottom: 0.5rem; font-weight: 500; }
input, textarea {
  width: 100%; padding: 0.7rem;
  border-radius: 8px;
  border: 1px solid #444;
  background: #0f0f1f;
  color: white;
  margin-bottom: 1rem;
}
button {
  background: linear-gradient(to right, #8b5cf6, #ec4899);
  border: none;
  border-radius: 8px;
  color: white;
  padding: 0.7rem 1.2rem;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
}
button:hover { opacity: 0.9; }

/* User Section */
.user-card {
  background: #27233a;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.user-info { display: flex; align-items: center; gap: 0.8rem; }
.user-pic { width: 50px; height: 50px; border-radius: 50%; display: none; }
.avatar {
  width: 50px; height: 50px;
  border-radius: 50%;
  background: #8b5cf6;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: bold;
}
.usage { text-align: right; font-size: 0.9rem; }

/* Reaction Buttons */
.reaction-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1rem;
}
.reaction-item {
  background: #2e2a44;
  padding: 0.8rem;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  transition: 0.3s;
}
.reaction-item.active, .reaction-item:hover {
  background: #8b5cf6;
  transform: scale(1.1);
}

/* Modal */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-content {
  background: #1e1b2e;
  border-radius: 12px;
  padding: 1.5rem;
  width: 90%; max-width: 400px;
  text-align: center;
}
.modal-content iframe {
  width: 100%; height: 200px;
  border-radius: 8px; margin-top: 1rem;
}
.modal-content button {
  margin-top: 1rem;
  background: #8b5cf6;
}

/* Cooldown/Limit */
.hidden { display: none !important; }
.cooldown-indicator {
  width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; display: inline-block;
}
.cooldown-active { background: #f59e0b; }
.cooldown-inactive { background: #10b981; }

/* Logout */
.logout-btn {
  margin: 1rem auto;
  display: block;
  background: #ef4444;
  max-width: 200px;
}

/* Responsive */
@media (max-width: 600px) {
  .user-card { flex-direction: column; text-align: center; }
  .user-info { flex-direction: column; }
}