/* SASUGA — tema gelap, aksen emas Genshin */
:root {
  --bg: #0e1220;
  --panel: #161c2e;
  --panel2: #1d2438;
  --line: #2a3350;
  --text: #e8ecf8;
  --muted: #8b93b0;
  --gold: #ffd66b;
  --cyan: #6cd8ff;
  --green: #4ade80;
  --red: #f87171;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background:
    radial-gradient(1200px 500px at 80% -10%, #1b2544 0%, transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* --- header --- */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--gold);
}
.brand span {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .3px;
  color: var(--muted);
}

.pill {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.pill.idle        { color: var(--muted); }
.pill.connecting  { color: #fbbf24; animation: blink 1.2s infinite; }
.pill.live        { color: #052; background: var(--green); border-color: var(--green); }
.pill.error       { color: var(--red); border-color: var(--red); }
@keyframes blink { 50% { opacity: .5; } }

/* --- kontrol --- */
.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
}
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
input {
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  outline: none;
  min-width: 210px;
}
input:focus { border-color: var(--cyan); }

button {
  background: var(--panel2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--cyan); }
button.primary { background: var(--gold); color: #20180a; border-color: var(--gold); }
button:disabled { opacity: .45; cursor: not-allowed; }

.error {
  margin: 10px 22px 0;
  padding: 10px 14px;
  border: 1px solid var(--red);
  border-radius: 8px;
  color: var(--red);
  background: rgba(248, 113, 113, .08);
  font-size: 14px;
}

/* --- panel utama --- */
main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px 22px 30px;
}
@media (max-width: 900px) {
  main { grid-template-columns: 1fr; }
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: 55vh;
}
.panel h2 {
  margin: 0;
  padding: 12px 16px;
  font-size: 14px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.count {
  background: var(--gold);
  color: #20180a;
  border-radius: 999px;
  padding: 1px 9px;
  font-size: 12px;
  margin-left: 6px;
}

ul { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; }

/* --- chat --- */
.chat-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 14px;
}
.chat-item:nth-child(odd) { background: rgba(255, 255, 255, .03); }
.chat-user { color: var(--cyan); font-weight: 700; white-space: nowrap; }
.chat-text { word-break: break-word; }
.chat-time { margin-left: auto; color: var(--muted); font-size: 11px; }

/* --- antrian --- */
.empty {
  padding: 26px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
.empty code { color: var(--gold); }

.queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  margin: 6px 4px;
}
.queue-item.enter {
  animation: slide-in-left .5s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes slide-in-left {
  from { transform: translateX(-120%); opacity: 0; }
  to   { transform: translateX(0);      opacity: 1; }
}

.q-no {
  background: var(--gold);
  color: #20180a;
  font-weight: 800;
  border-radius: 8px;
  min-width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.q-main { min-width: 0; }
.q-uid {
  font-family: 'Consolas', monospace;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  color: #052;
  background: var(--green);
  border-radius: 999px;
  padding: 1px 8px;
  text-transform: uppercase;
}
.q-name {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.q-time { margin-left: auto; color: var(--muted); font-size: 11px; }
.q-del {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 20px;
  padding: 2px 8px;
  line-height: 1;
}
.q-del:hover { color: var(--red); }
