/* ====== GLOBAL ====== */
:root {
  --bg-main: #050814;
  --bg-card: #111322;
  --bg-bar: #090b18;
  --accent1: #ff5f6d;
  --accent2: #ffc371;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: var(--bg-main);
  color: #fff;
}

/* ====== APP BAR ====== */
.app-bar {
  padding: 12px 16px;
  background: #090b18;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-title {
  font-size: 18px;
  font-weight: bold;
}

/* ====== LAYOUT UTAMA ====== */
.container {
  padding: 16px;
  max-width: 480px;        /* tampilan HP, di desktop jadi kolom tengah */
  margin: 0 auto 80px;     /* jarak bawah untuk popup gift / elemen lain */
}

/* ====== INPUT / FORM UMUM ====== */
.input-group {
  margin-bottom: 12px;
}

label {
  font-size: 13px;
  color: #ccc;
  display: block;
  margin-bottom: 4px;
}

input,
select {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: none;
  outline: none;
  background: #111322;
  color: #fff;
  font-size: 14px;
}

/* ====== BUTTON UMUM ====== */
.btn-primary {
  width: 100%;
  padding: 12px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  color: #000;
  font-weight: bold;
  margin-top: 12px;
  cursor: pointer;
}

/* ====== ROOM CARD (untuk lobby) ====== */
.room-card {
  border-radius: 16px;
  background: linear-gradient(135deg, #222, #111);
  padding: 10px;
  margin-bottom: 10px;
}

/* ====== BOTTOM NAV (kalau dibutuhkan) ====== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #050814;
  border-top: 1px solid #191b2f;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.nav-item {
  text-align: center;
  font-size: 11px;
  color: #777;
}

.nav-item.active {
  color: #ffdd59;
}

/* ====== MIC / SEAT AREA ====== */
.mic-area {
  padding: 8px;
  background: #0a0d20;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  border-radius: 14px;
  margin-bottom: 12px;
}

.mic-slot {
  width: 23%;
  margin: 4px 0;
  text-align: center;
  font-size: 11px;
  color: #aaa;
}

.mic-avatar {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  margin: 0 auto 4px;
  background: #222;
  border: 1px solid #444;
}

.mic-slot.host .mic-avatar {
  border-color: #ffdd59;
}

.seat-label {
  font-size: 10px;
  color: #666;
}

/* ====== CHAT AREA ====== */
.chat-area {
  background: #0e0f1a;
  border-radius: 12px;
  padding: 10px;
  height: 55vh;                  /* tinggi chat area */
  display: flex;
  flex-direction: column;
}

/* LIST PESAN */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 10px;
  padding-right: 4px;
}

/* SCROLLBAR TIPIS */
.chat-messages::-webkit-scrollbar {
  width: 4px;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 999px;
}

/* SATU BARIS CHAT */
.chat-line {
  font-size: 13px;
  margin-bottom: 3px;
}

.chat-name {
  font-weight: bold;
  margin-right: 4px;
}

.chat-msg {
  word-wrap: break-word;
}

/* WARNA BERDASARKAN ROLE */
.chat-line--admin .chat-name {
  color: #ff6b6b;
}
.chat-line--host .chat-name {
  color: #c084fc;
}
.chat-line--agency .chat-name {
  color: #4aa3ff;
}
.chat-line--vip .chat-name {
  color: #ffd93d;
}
.chat-line--user .chat-name {
  color: #a2ff7a;
}

/* INPUT + TOMBOL SEND */
.chat-input-bar {
  display: flex;
  gap: 10px;
}

.chat-input {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: #1e1f2b;
  color: #fff;
}

.btn-send {
  padding: 12px 20px;
  background: #ff6b7a;
  border: none;
  color: white;
  border-radius: 10px;
  cursor: pointer;
}

/* ====== TOMBOL GIFT DI BAWAH CHAT ====== */
.btn-gift {
  width: 100%;
  margin-top: 12px;
  padding: 13px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  color: #000;
  font-weight: bold;
  font-size: 15px;
  cursor: pointer;
}

.btn-gift:active {
  transform: scale(0.98);
}

/* ====== GIFT OVERLAY (ANIMASI DI LAYAR) ====== */
#gift_overlay {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 80px;
  pointer-events: none;
  z-index: 40;
  display: flex;
  justify-content: center;
  align-items: center;
}

.gift-flying {
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 14px;
  animation: giftFly 1.4s ease-out forwards;
}

@keyframes giftFly {
  0%   { transform: translateY(40px) scale(0.6); opacity: 0; }
  30%  { transform: translateY(0)    scale(1);   opacity: 1; }
  80%  { transform: translateY(-40px) scale(1.05); opacity: 1; }
  100% { transform: translateY(-80px) scale(0.9);  opacity: 0; }
}

/* ====== CHAT AVATAR + BADGE + LEVEL ====== */

.chat-area {
  background: #0e0f1a;
  border-radius: 10px;
  padding: 10px;
  height: 55vh;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 10px;
  padding-right: 6px;
}

.chat-input-bar {
  display: flex;
  gap: 10px;
}

.chat-input {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: #1e1f2b;
  color: #fff;
}

.btn-send {
  padding: 12px 20px;
  background: #ff6b7a;
  border: none;
  color: white;
  border-radius: 10px;
}

/* baris chat */
.chat-line {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}

/* avatar bulat */
.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #222;
  color: #fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:bold;
  font-size:14px;
  flex-shrink:0;
  background-size: cover;
  background-position: center;
}

/* container teks */
.chat-body {
  flex: 1;
}

/* header: nama + badge + level */
.chat-header {
  display:flex;
  align-items:center;
  gap:4px;
  margin-bottom: 2px;
}

.chat-name {
  font-weight: 600;
}

/* isi pesan */
.chat-msg {
  color:#ddd;
}

/* badge role */
.chat-badge {
  padding:2px 6px;
  border-radius:999px;
  font-size:10px;
  font-weight:600;
}

/* warna per-role */
.chat-line--admin .chat-avatar { background:#4b1b2a; }
.chat-line--host  .chat-avatar { background:#36225f; }
.chat-line--agency .chat-avatar { background:#14324d; }
.chat-line--vip   .chat-avatar { background:#5a430f; }
.chat-line--user  .chat-avatar { background:#1b3b26; }
.chat-line--system .chat-avatar { background:#333; }

.chat-badge--admin  { background:#ff6b6b; color:#000; }
.chat-badge--host   { background:#c084fc; color:#000; }
.chat-badge--agency { background:#4aa3ff; color:#000; }
.chat-badge--vip    { background:#ffd93d; color:#000; }
.chat-badge--user   { background:#a2ff7a; color:#000; }
.chat-badge--system { background:#999;   color:#000; }

/* level kecil di kanan */
.chat-level {
  font-size:10px;
  color:#bbb;
}

/* tombol gift di bawah chat */
.btn-gift {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(90deg,#ff5f6d,#ffc371);
  font-weight: bold;
  font-size: 15px;
  cursor: pointer;
}

/* animasi gift terbang */
#gift_overlay {
  position: fixed;
  left: 0;
  right: 0;
  top: 15%;
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 40;
}

.gift-flying {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0,0,0,0.75);
  border: 1px solid #ffc371;
  color: #fff;
  font-size: 13px;
  animation: giftFloat 1.5s ease-out forwards;
}

@keyframes giftFloat {
  from { transform: translateY(20px); opacity: 0; }
  30% { opacity: 1; }
  to   { transform: translateY(-40px); opacity: 0; }
}

/* seat avatar huruf di area mic */
.mic-avatar {
  width:42px;
  height:42px;
  border-radius:999px;
  margin:0 auto 4px;
  background:#222;
  border:1px solid #444;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:bold;
  font-size:15px;
}
.mic-slot.host .mic-avatar {
  border-color:#ffdd59;
}

