:root {
  --bg: #0f1220;
  --panel: #171b2e;
  --panel-2: #1f2440;
  --border: #2b3157;
  --text: #e9ebf5;
  --muted: #8a90b3;
  --accent: #5865F2; /* warna Discord */
  --accent-2: #00d4a0;
  --danger: #ff4d6d;
  --warn: #ffb020;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: radial-gradient(circle at top, #1a1f38, var(--bg));
  color: var(--text);
  min-height: 100vh;
}

.center-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
  text-align: center;
  padding: 20px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

h1, h2, h3 { margin: 0 0 8px; }
p.subtitle { color: var(--muted); margin-top: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: transform .15s ease, opacity .15s ease;
}
.btn:hover { transform: translateY(-1px); opacity: .92; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }

.btn-discord { background: var(--accent); color: white; }
.btn-primary { background: var(--accent-2); color: #04241c; }
.btn-danger { background: var(--danger); color: white; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }

input[type=text] {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 15px;
  width: 100%;
}

/* ---------- Layout Dashboard ---------- */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr 320px;
  height: 100vh;
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; grid-auto-rows: auto; height: auto; }
}

.sidebar, .side-panel {
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 18px;
  overflow-y: auto;
}
.side-panel { border-right: none; border-left: 1px solid var(--border); }

.main-panel { display: flex; flex-direction: column; padding: 18px; overflow: hidden; }

.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
}
.pill.admin { background: rgba(255,176,32,.15); color: var(--warn); border-color: rgba(255,176,32,.4); }
.pill.online { background: rgba(0,212,160,.15); color: var(--accent-2); border-color: rgba(0,212,160,.4); }

/* ---------- Papan Jawaban ---------- */
.board {
  background: #0b0d1c;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  text-align: center;
  padding: 24px;
  margin-bottom: 16px;
  color: var(--accent-2);
}

/* ---------- Buzzer ---------- */
.buzzer-btn {
  width: 100%;
  padding: 30px;
  font-size: 22px;
  font-weight: 800;
  border-radius: 18px;
  border: none;
  background: linear-gradient(160deg, #ff5c7a, var(--danger));
  color: white;
  cursor: pointer;
  box-shadow: 0 8px 0 #a12038;
  transition: transform .08s ease, box-shadow .08s ease;
}
.buzzer-btn:active { transform: translateY(6px); box-shadow: 0 2px 0 #a12038; }
.buzzer-btn:disabled {
  background: #3a3f5f;
  box-shadow: 0 8px 0 #24273f;
  cursor: not-allowed;
  color: var(--muted);
}

.buzzer-status {
  text-align: center;
  margin-top: 12px;
  font-weight: 600;
  min-height: 20px;
}

/* ---------- Chat ---------- */
.chat-box {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0;
}
.chat-msg { background: var(--panel-2); padding: 8px 12px; border-radius: 10px; max-width: 90%; }
.chat-msg .name { font-size: 12px; color: var(--accent-2); font-weight: 700; }
.chat-msg .name.admin-name { color: var(--warn); }
.chat-input-row { display: flex; gap: 8px; margin-top: 8px; }
.chat-input-row input { flex: 1; }

/* ---------- Emoji Bar ---------- */
.emoji-bar { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.emoji-bar button {
  font-size: 22px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
}
.emoji-bar button:hover { background: var(--accent); }

/* Emoji bubble mengambang di layar */
.emoji-float {
  position: fixed;
  bottom: 0;
  font-size: 40px;
  pointer-events: none;
  animation: floatUp 3.5s ease-in forwards;
  z-index: 9999;
  text-align: center;
}
.emoji-float .who { font-size: 11px; color: var(--muted); background: rgba(0,0,0,.4); border-radius: 6px; padding: 1px 5px; }
@keyframes floatUp {
  0% { transform: translateY(0) translateX(0) scale(0.6); opacity: 0; }
  10% { opacity: 1; transform: scale(1); }
  100% { transform: translateY(-90vh) translateX(var(--drift, 0px)) scale(1); opacity: 0; }
}

/* Team & member list */
.member-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  margin-bottom: 6px;
  background: var(--panel-2);
}
.member-item img { width: 32px; height: 32px; border-radius: 50%; }
.member-item .mic-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--muted); margin-left: auto;
}
.member-item .mic-dot.live { background: var(--accent-2); box-shadow: 0 0 8px var(--accent-2); }

.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 8px; }

.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }

/* ---------- Room cards ---------- */
.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  max-width: 900px;
  width: 100%;
}
.room-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: left;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease;
}
.room-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.room-card h3 { margin: 0 0 6px; }
.room-card .meta { color: var(--muted); font-size: 13px; }
.room-card.inactive { opacity: .5; }
.room-card.new-room {
  display: flex; align-items: center; justify-content: center;
  border-style: dashed; color: var(--muted); font-weight: 600; font-size: 16px;
}

/* ---------- List item admin manage ---------- */
.manage-item {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.manage-item .info { flex: 1; min-width: 180px; }
.manage-item .code-box {
  font-family: monospace;
  background: #0b0d1c;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  letter-spacing: 1px;
}
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; }
.actions-row .btn { padding: 8px 14px; font-size: 13px; }

.badge-spectator {
  display: inline-block;
  background: rgba(138,144,179,.15);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  margin-bottom: 10px;
}
